summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2010-05-17 01:18:12 +0000
committerrmacklem <rmacklem@FreeBSD.org>2010-05-17 01:18:12 +0000
commit7f3db98fba4e727a5c118996b65ca379e4977488 (patch)
treeb16548c437db20c3a67d617ba13236073b8137b0
parentc99a7622b2e3f25556ead949b8dfc9fb36df892b (diff)
downloadFreeBSD-src-7f3db98fba4e727a5c118996b65ca379e4977488.zip
FreeBSD-src-7f3db98fba4e727a5c118996b65ca379e4977488.tar.gz
MFC: r207689
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.
-rw-r--r--usr.sbin/mountd/mountd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c
index 340afd3..41a845f 100644
--- a/usr.sbin/mountd/mountd.c
+++ b/usr.sbin/mountd/mountd.c
@@ -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);
}
OpenPOWER on IntegriCloud