Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/usr.sbin/mountd Pull up revision 1.77 (requested by fvdl):



details:   https://anonhg.NetBSD.org/src/rev/8af1d06d1e98
branches:  netbsd-1-5
changeset: 491520:8af1d06d1e98
user:      he <he%NetBSD.org@localhost>
date:      Tue May 01 12:11:56 2001 +0000

description:
Pull up revision 1.77 (requested by fvdl):
  Fix some minor security-related issues.

diffstat:

 usr.sbin/mountd/mountd.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (42 lines):

diff -r cd968984fe46 -r 8af1d06d1e98 usr.sbin/mountd/mountd.c
--- a/usr.sbin/mountd/mountd.c  Tue May 01 12:07:37 2001 +0000
+++ b/usr.sbin/mountd/mountd.c  Tue May 01 12:11:56 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mountd.c,v 1.70.2.5 2000/07/22 01:42:31 enami Exp $     */
+/*     $NetBSD: mountd.c,v 1.70.2.6 2001/05/01 12:11:56 he Exp $        */
 
 /*
  * Copyright (c) 1989, 1993
@@ -51,7 +51,7 @@
 #if 0
 static char     sccsid[] = "@(#)mountd.c  8.15 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: mountd.c,v 1.70.2.5 2000/07/22 01:42:31 enami Exp $");
+__RCSID("$NetBSD: mountd.c,v 1.70.2.6 2001/05/01 12:11:56 he Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -2151,6 +2151,12 @@
        } else
                goto fail;
 
+       /*
+        * Only allow /pref notation for v6 addresses.
+        */
+       if (sa->sa_family == AF_INET6 && (!(opt_flags & OP_MASKLEN) || maskflg))
+               return 1;
+
        ecode = getnameinfo(sa, sa->sa_len, netname, sizeof netname,
            NULL, 0, NI_NUMERICHOST);
        if (ecode != 0)
@@ -2517,8 +2523,8 @@
                return (1);
        }
        if ((opt_flags & OP_MASK) && (opt_flags & OP_MASKLEN) != 0) {
-               syslog(LOG_ERR, "\"%s\", line %ld: /pref and -net mutually"
-                   "exclusive",
+               syslog(LOG_ERR, "\"%s\", line %ld: /pref and -mask mutually"
+                   " exclusive",
                    line, (unsigned long)lineno);
                return (1);
        }



Home | Main Index | Thread Index | Old Index