According to the exports(5) manual page if a line starts with a single pathname of the root of the file system followed by the -alldirs option. This option allows to specify that this is a file system export, does not matter whether it is mounted right now or will be mounted in future. mountd starting from the 1.84 revision of the usr.sbin/mountd/mountd.c file ignores the -alldirs option (> 5 years ago). It silently treats the given pathname as a directory name and exports the entire file system this directory belongs to. Actually it has to export the given pathname only if it is a mount point. This is a security issue, since mountd violates exports(5) rules. Also the following update corrects segmentation fault if the -sec option is given without an argument. Fix: [ patch elided - gavin@ ] How-To-Repeat: Create the /etc/exports file with this content: /cdrom -alldirs Suppose /cdrom is not a mount point, now run mountd and try to mount the <server>:/ NFS export, you will get access to the root file system.
Author: pluknet Date: Wed Feb 20 12:40:26 2013 New Revision: 247034 URL: http://svnweb.freebsd.org/changeset/base/247034 Log: Check if the -sec option is given without an argument. PR: bin/170413 Submitted by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua> 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 Feb 20 12:14:49 2013 (r247033) +++ head/usr.sbin/mountd/mountd.c Wed Feb 20 12:40:26 2013 (r247034) @@ -2235,7 +2235,7 @@ do_opt(char **cpp, char **endcpp, struct ep->ex_indexfile = strdup(cpoptarg); } else if (!strcmp(cpopt, "quiet")) { opt_flags |= OP_QUIET; - } else if (!strcmp(cpopt, "sec")) { + } else if (cpoptarg && !strcmp(cpopt, "sec")) { if (parsesec(cpoptarg, ep)) return (1); opt_flags |= OP_SEC; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Author: pluknet Date: Wed Feb 27 08:55:26 2013 New Revision: 247394 URL: http://svnweb.freebsd.org/changeset/base/247394 Log: MFC r247034: Check if the -sec option is given without an argument. PR: bin/170413 Submitted by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua> Modified: stable/9/usr.sbin/mountd/mountd.c Directory Properties: stable/9/usr.sbin/mountd/ (props changed) Modified: stable/9/usr.sbin/mountd/mountd.c ============================================================================== --- stable/9/usr.sbin/mountd/mountd.c Wed Feb 27 08:44:03 2013 (r247393) +++ stable/9/usr.sbin/mountd/mountd.c Wed Feb 27 08:55:26 2013 (r247394) @@ -2238,7 +2238,7 @@ do_opt(char **cpp, char **endcpp, struct ep->ex_indexfile = strdup(cpoptarg); } else if (!strcmp(cpopt, "quiet")) { opt_flags |= OP_QUIET; - } else if (!strcmp(cpopt, "sec")) { + } else if (cpoptarg && !strcmp(cpopt, "sec")) { if (parsesec(cpoptarg, ep)) return (1); opt_flags |= OP_SEC; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Author: pluknet Date: Wed Feb 27 08:56:57 2013 New Revision: 247395 URL: http://svnweb.freebsd.org/changeset/base/247395 Log: MFC r247034: Check if the -sec option is given without an argument. PR: bin/170413 Submitted by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua> Modified: stable/8/usr.sbin/mountd/mountd.c Directory Properties: stable/8/usr.sbin/mountd/ (props changed) Modified: stable/8/usr.sbin/mountd/mountd.c ============================================================================== --- stable/8/usr.sbin/mountd/mountd.c Wed Feb 27 08:55:26 2013 (r247394) +++ stable/8/usr.sbin/mountd/mountd.c Wed Feb 27 08:56:57 2013 (r247395) @@ -2229,7 +2229,7 @@ do_opt(char **cpp, char **endcpp, struct ep->ex_indexfile = strdup(cpoptarg); } else if (!strcmp(cpopt, "quiet")) { opt_flags |= OP_QUIET; - } else if (!strcmp(cpopt, "sec")) { + } else if (cpoptarg && !strcmp(cpopt, "sec")) { if (parsesec(cpoptarg, ep)) return (1); opt_flags |= OP_SEC; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed Submitter requests that this PR be closed.