View | Details | Raw Unified | Return to bug 282995
Collapse All | Expand All

(-)usr.sbin/mountd/mountd.c (-13 / +21 lines)
Lines 312-317 static struct pidfh *pfh = NULL; Link Here
312
#define OP_MASKLEN	0x200
312
#define OP_MASKLEN	0x200
313
#define OP_SEC		0x400
313
#define OP_SEC		0x400
314
#define OP_CLASSMASK	0x800	/* mask not specified, is Class A/B/C default */
314
#define OP_CLASSMASK	0x800	/* mask not specified, is Class A/B/C default */
315
#define	OP_NOTROOT	0x1000	/* Mark the the mount path is not a fs root */
315
316
316
#ifdef DEBUG
317
#ifdef DEBUG
317
static int debug = 1;
318
static int debug = 1;
Lines 1572-1577 get_exportlist_one(int passno) Link Here
1572
	anon.cr_groups = NULL;
1573
	anon.cr_groups = NULL;
1573
	dirhead = (struct dirlist *)NULL;
1574
	dirhead = (struct dirlist *)NULL;
1574
	unvis_dir[0] = '\0';
1575
	unvis_dir[0] = '\0';
1576
	fsb.f_mntonname[0] = '\0';
1575
	while (get_line()) {
1577
	while (get_line()) {
1576
		if (debug)
1578
		if (debug)
1577
			warnx("got line %s", line);
1579
			warnx("got line %s", line);
Lines 1712-1730 get_exportlist_one(int passno) Link Here
1712
						fsb.f_fsid.val[1]);
1714
						fsb.f_fsid.val[1]);
1713
				    }
1715
				    }
1714
1716
1715
				    if (warn_admin != 0 &&
1717
				    if (strcmp(unvis_dir, fsb.f_mntonname) !=
1716
					(ep->ex_flag & EX_ADMINWARN) == 0 &&
1718
					0)
1717
					strcmp(unvis_dir, fsb.f_mntonname) !=
1719
					opt_flags |= OP_NOTROOT;
1718
					0) {
1719
					if (debug)
1720
					    warnx("exporting %s exports entire "
1721
						"%s file system", unvis_dir,
1722
						    fsb.f_mntonname);
1723
					syslog(LOG_ERR, "Warning: exporting %s "
1724
					    "exports entire %s file system",
1725
					    unvis_dir, fsb.f_mntonname);
1726
					ep->ex_flag |= EX_ADMINWARN;
1727
				    }
1728
1720
1729
				    /*
1721
				    /*
1730
				     * Add dirpath to export mount point.
1722
				     * Add dirpath to export mount point.
Lines 1794-1799 get_exportlist_one(int passno) Link Here
1794
			    "WARNING: No mask specified for %s, "
1786
			    "WARNING: No mask specified for %s, "
1795
			    "using out-of-date default",
1787
			    "using out-of-date default",
1796
			    (&grp->gr_ptr.gt_net)->nt_name);
1788
			    (&grp->gr_ptr.gt_net)->nt_name);
1789
		if ((opt_flags & OP_NOTROOT) != 0 && warn_admin != 0 &&
1790
		    (ep->ex_flag & EX_ADMINWARN) == 0 && unvis_dir[0] != '\0' &&
1791
		    fsb.f_mntonname[0] != '\0') {
1792
			if (debug)
1793
				warnx("exporting %s exports entire %s file "
1794
				    "system", unvis_dir, fsb.f_mntonname);
1795
			syslog(LOG_ERR, "Warning: exporting %s exports "
1796
			    "entire %s file system", unvis_dir,
1797
			    fsb.f_mntonname);
1798
			ep->ex_flag |= EX_ADMINWARN;
1799
		}
1797
		if (check_options(dirhead)) {
1800
		if (check_options(dirhead)) {
1798
			getexp_err(ep, tgrp, NULL);
1801
			getexp_err(ep, tgrp, NULL);
1799
			goto nextline;
1802
			goto nextline;
Lines 2904-2909 do_opt(char **cpp, char **endcpp, struct exportlist *e Link Here
2904
		} else if (!strcmp(cpopt, "alldirs")) {
2907
		} else if (!strcmp(cpopt, "alldirs")) {
2905
			if (fnd_equal == 1) {
2908
			if (fnd_equal == 1) {
2906
				syslog(LOG_ERR, "= after op: %s", cpopt);
2909
				syslog(LOG_ERR, "= after op: %s", cpopt);
2910
				return (1);
2911
			}
2912
			if ((opt_flags & OP_NOTROOT) != 0) {
2913
				syslog(LOG_ERR, "%s for non-fs root dir",
2914
				    cpopt);
2907
				return (1);
2915
				return (1);
2908
			}
2916
			}
2909
			opt_flags |= OP_ALLDIRS;
2917
			opt_flags |= OP_ALLDIRS;

Return to bug 282995