Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-4]: src/usr.sbin/amd/amd pull up rev 1.9 from trunk (requested ...
details: https://anonhg.NetBSD.org/src/rev/84eea09c2fa0
branches: netbsd-1-4
changeset: 469422:84eea09c2fa0
user: cgd <cgd%NetBSD.org@localhost>
date: Tue Sep 21 04:54:28 1999 +0000
description:
pull up rev 1.9 from trunk (requested by christos):
Upgrade amd(8) and related software to fix expoitable stack overflows
in amq(8), as reported in BUGTRAQ and elsewhere.
diffstat:
usr.sbin/amd/amd/am_ops.c | 37 +++++++++++++++++++++++++++----------
1 files changed, 27 insertions(+), 10 deletions(-)
diffs (67 lines):
diff -r ff68fd091ca4 -r 84eea09c2fa0 usr.sbin/amd/amd/am_ops.c
--- a/usr.sbin/amd/amd/am_ops.c Tue Sep 21 04:54:22 1999 +0000
+++ b/usr.sbin/amd/amd/am_ops.c Tue Sep 21 04:54:28 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: am_ops.c,v 1.8 1999/02/01 19:05:09 christos Exp $ */
+/* $NetBSD: am_ops.c,v 1.8.2.1 1999/09/21 04:54:28 cgd Exp $ */
/*
* Copyright (c) 1997-1999 Erez Zadok
@@ -40,7 +40,7 @@
*
* %W% (Berkeley) %G%
*
- * Id: am_ops.c,v 1.3 1999/01/10 21:53:39 ezk Exp
+ * Id: am_ops.c,v 1.4 1999/03/13 17:03:26 ezk Exp
*
*/
@@ -166,7 +166,7 @@
if (ap[1])
strcat(buf, ", ");
l += strlen((*ap)->fs_type) + 2;
- if (l > 60) {
+ if (l > 62) {
l = 0;
strcat(buf, "\n ");
}
@@ -415,15 +415,32 @@
/*
* If addopts option was used, then append it to the
- * current options.
+ * current options and remote mount options.
*/
if (fo->opt_addopts) {
- char *mergedstr;
- mergedstr = merge_opts(fo->opt_opts, fo->opt_addopts);
- plog(XLOG_USER, "merge opts \"%s\" add \"%s\" => \"%s\"",
- fo->opt_opts, fo->opt_addopts, mergedstr);
- XFREE(fo->opt_opts);
- fo->opt_opts = mergedstr;
+ if (STREQ(fo->opt_opts, fo->opt_remopts)) {
+ /* optimize things for the common case where opts==remopts */
+ char *mergedstr;
+ mergedstr = merge_opts(fo->opt_opts, fo->opt_addopts);
+ plog(XLOG_USER, "merge rem/opts \"%s\" add \"%s\" => \"%s\"",
+ fo->opt_opts, fo->opt_addopts, mergedstr);
+ XFREE(fo->opt_opts);
+ XFREE(fo->opt_remopts);
+ fo->opt_opts = mergedstr;
+ fo->opt_remopts = strdup(mergedstr);
+ } else {
+ char *mergedstr, *remmergedstr;
+ mergedstr = merge_opts(fo->opt_opts, fo->opt_addopts);
+ plog(XLOG_USER, "merge opts \"%s\" add \"%s\" => \"%s\"",
+ fo->opt_opts, fo->opt_addopts, mergedstr);
+ XFREE(fo->opt_opts);
+ fo->opt_opts = mergedstr;
+ remmergedstr = merge_opts(fo->opt_remopts, fo->opt_addopts);
+ plog(XLOG_USER, "merge remopts \"%s\" add \"%s\" => \"%s\"",
+ fo->opt_remopts, fo->opt_addopts, remmergedstr);
+ XFREE(fo->opt_remopts);
+ fo->opt_remopts = remmergedstr;
+ }
}
/*
Home |
Main Index |
Thread Index |
Old Index