* amd/srvr_nfs.c: comment on NFS proto search order.
authorErez Zadok <ezk@cs.sunysb.edu>
Fri, 24 Nov 2000 21:29:14 +0000 (21:29 +0000)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 24 Nov 2000 21:29:14 +0000 (21:29 +0000)
* libamu/xutil.c (real_plog): don't try to write the last byte of
the fmt buf.  security suggtion from NetBSD: Thomas Klausner
<wiz@danbala.ifoer.tuwien.ac.at>

* libamu/mount_fs.c (mount_fs): avoid using extra limited-size buf
(security)

ChangeLog
amd/srvr_nfs.c
libamu/mount_fs.c
libamu/xutil.c

index d1294d06463a9da33dbd24690268dc1899de0d27..d739f02d8e38a3745bd94f0e21de27385fb4b82d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2000-11-24  Erez Zadok  <ezk@shekel.mcl.cs.columbia.edu>
+
+       * amd/srvr_nfs.c: comment on NFS proto search order.
+
+       * libamu/xutil.c (real_plog): don't try to write the last byte of
+       the fmt buf.  security suggtion from NetBSD: Thomas Klausner
+       <wiz@danbala.ifoer.tuwien.ac.at>
+
 2000-11-22  Ion Badulescu  <ionut@moisil.dev.hydraweb.com>
 
        * amd/amfs_auto.c (amfs_auto_bgmount),
@@ -10,6 +18,9 @@
 
 2000-11-22  Thomas Klausner <wiz@danbala.ifoer.tuwien.ac.at>
 
+       * libamu/mount_fs.c (mount_fs): avoid using extra limited-size buf
+       (security)
+
        * libamu/xutil.c, fsinfo/fsinfo.h, include/am_utils.h: use
        __attribute__, __format__, and __printf__ for GCC string auditing.
 
index 1ea045a6ffee292320acedb1c2c8859345ae5471..5c10d67cef1f714ff03679ab341969df839352fa 100644 (file)
@@ -38,7 +38,7 @@
  *
  *      %W% (Berkeley) %G%
  *
- * $Id: srvr_nfs.c,v 1.7 2000/02/16 13:52:57 ezk Exp $
+ * $Id: srvr_nfs.c,v 1.7.2.1 2000/11/24 21:29:15 ezk Exp $
  *
  */
 
@@ -93,7 +93,13 @@ static int ping_len;
 static char ping_buf[sizeof(struct rpc_msg) + 32];
 
 #if defined(MNTTAB_OPT_PROTO) || defined(HAVE_FS_NFS3)
-/* protocols we know about, in order of preference */
+/*
+ * Protocols we know about, in order of preference.
+ *
+ * Note that Solaris 8 and newer NetBSD systems are switching to UDP first,
+ * so this order may have to be adjusted for Amd in the future once more
+ * vendors make that change. -Erez 11/24/2000
+ */
 static char *protocols[] = { "tcp", "udp", NULL };
 #endif /* defined(MNTTAB_OPT_PROTO) || defined(HAVE_FS_NFS3) */
 
index 620e1424a0b67a90c1560ba88ee5ecad33f9f88b..9f1735a70b466eb79d9eed2243e06a49faa0d8f4 100644 (file)
@@ -38,7 +38,7 @@
  *
  *      %W% (Berkeley) %G%
  *
- * $Id: mount_fs.c,v 1.11.2.1 2000/11/22 10:13:43 ezk Exp $
+ * $Id: mount_fs.c,v 1.11.2.2 2000/11/24 21:29:15 ezk Exp $
  *
  */
 
@@ -181,14 +181,10 @@ mount_fs(mntent_t *mnt, int flags, caddr_t mnt_data, int retry, MTYPE_TYPE type,
   char optsbuf[48];
 # endif /* defined(MNTTAB_OPT_DEV) || (defined(HAVE_FS_NFS3) && defined(MNTTAB_OPT_VERS)) || defined(MNTTAB_OPT_PROTO) */
 #endif /* MOUNT_TABLE_ON_FILE */
-#ifdef DEBUG
-  char buf[80];                        /* buffer for sprintf */
-#endif /* DEBUG */
 
 #ifdef DEBUG
-  sprintf(buf, "%s%s%s",
-         "%s fstype ", MTYPE_PRINTF_TYPE, " (%s) flags %#x (%s)");
-  dlog(buf, mnt->mnt_dir, type, mnt->mnt_type, flags, mnt->mnt_opts);
+  dlog("%s fstype " MTYPE_PRINTF_TYPE " (%s) flags %#x (%s)",
+       mnt->mnt_dir, type, mnt->mnt_type, flags, mnt->mnt_opts);
 #endif /* DEBUG */
 
 again:
index f7e1f7f0f54912ed4d4eed93b93274b791644109..9427fd88dbfeb1e4e106d24f4df4f7bdf2355e4a 100644 (file)
@@ -38,7 +38,7 @@
  *
  *      %W% (Berkeley) %G%
  *
- * $Id: xutil.c,v 1.11.2.4 2000/11/22 10:13:44 ezk Exp $
+ * $Id: xutil.c,v 1.11.2.5 2000/11/24 21:29:16 ezk Exp $
  *
  */
 
@@ -293,6 +293,12 @@ static const char *
 expand_error(const char *f, char *e, int maxlen)
 {
 #ifndef HAVE_STRERROR
+  /*
+   * XXX: we are assuming that if a system doesn't has strerror,
+   * then it has sys_nerr.  If this assumption turns out to be wrong on
+   * some systems, we'll have to write a separate test to detect if
+   * a system has sys_nerr.  -Erez
+   */
   extern int sys_nerr;
 #endif /* not HAVE_STRERROR */
   const char *p;
@@ -472,7 +478,7 @@ real_plog(int lvl, const char *fmt, va_list vargs)
    * more than 1024 bytes, if efmt is already large, and vargs expand
    * as well.  This is not as safe as using vsnprintf().
    */
-  vsprintf(ptr, expand_error(fmt, efmt, 1024), vargs);
+  vsprintf(ptr, expand_error(fmt, efmt, 1023), vargs);
   msg[1023] = '\0';            /* null terminate, to be sure */
 #endif /* not HAVE_VSNPRINTF */