+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),
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.
*
* %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 $
*
*/
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) */
*
* %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 $
*
*/
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:
*
* %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 $
*
*/
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;
* 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 */