svn commit: r207689 - head/usr.sbin/mountd

Rick Macklem rmacklem at FreeBSD.org
Thu May 6 00:24:09 UTC 2010


Author: rmacklem
Date: Thu May  6 00:24:08 2010
New Revision: 207689
URL: http://svn.freebsd.org/changeset/base/207689

Log:
  If the "-alldirs" export option was used for the V4: line, mountd
  would crash in check_options() since dp == NULL for the V4: line.
  This patch moves the check for options allowed on the V4: line to
  ahead of where dp is used to avoid this crash.
  
  Reported by:	mamalos AT eng.auth.gr
  MFC after:	1 week

Modified:
  head/usr.sbin/mountd/mountd.c

Modified: head/usr.sbin/mountd/mountd.c
==============================================================================
--- head/usr.sbin/mountd/mountd.c	Wed May  5 22:52:06 2010	(r207688)
+++ head/usr.sbin/mountd/mountd.c	Thu May  6 00:24:08 2010	(r207689)
@@ -2881,16 +2881,16 @@ check_options(dp)
 		syslog(LOG_ERR, "-mask and /masklen are mutually exclusive");
 		return (1);
 	}
-	if ((opt_flags & OP_ALLDIRS) && dp->dp_left) {
-	    syslog(LOG_ERR, "-alldirs has multiple directories");
-	    return (1);
-	}
 	if (v4root_phase > 0 &&
 	    (opt_flags &
 	     ~(OP_SEC | OP_MASK | OP_NET | OP_HAVEMASK | OP_MASKLEN)) != 0) {
 	    syslog(LOG_ERR,"only -sec,-net,-mask options allowed on V4:");
 	    return (1);
 	}
+	if ((opt_flags & OP_ALLDIRS) && dp->dp_left) {
+	    syslog(LOG_ERR, "-alldirs has multiple directories");
+	    return (1);
+	}
 	return (0);
 }
 


More information about the svn-src-head mailing list