diff options
author | jlemon <jlemon@FreeBSD.org> | 1997-09-12 16:25:24 +0000 |
---|---|---|
committer | jlemon <jlemon@FreeBSD.org> | 1997-09-12 16:25:24 +0000 |
commit | 551d6af699d053638ed88fdf543c957fe35009c1 (patch) | |
tree | 806a36d044bb817ad708b1bee0c0241da76a7ad0 /usr.sbin/mountd | |
parent | 0eba88d0be7e6e2f8d45f440de4767003f6274dc (diff) | |
download | FreeBSD-src-551d6af699d053638ed88fdf543c957fe35009c1.zip FreeBSD-src-551d6af699d053638ed88fdf543c957fe35009c1.tar.gz |
If a host in an export line in /etc/exports (or within a netgroup on
an export line) is unresolvable, make a note of it via syslog and skip
that individual host instead of skipping the entire line.
PR: 1981, 815
Perused by: joerg
Diffstat (limited to 'usr.sbin/mountd')
-rw-r--r-- | usr.sbin/mountd/mountd.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 38ead40..b82a0f3 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -43,7 +43,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95"; */ static const char rcsid[] = - "$Id: mountd.c,v 1.22 1997/07/16 09:27:53 dfr Exp $"; + "$Id: mountd.c,v 1.23 1997/08/29 19:22:28 guido Exp $"; #endif /*not lint*/ #include <sys/param.h> @@ -873,14 +873,12 @@ get_exportlist() } if (netgrp) { if (get_host(hst, grp, tgrp)) { - syslog(LOG_ERR, "Bad netgroup %s", cp); - getexp_err(ep, tgrp); - endnetgrent(); - goto nextline; + syslog(LOG_ERR, "Bad host %s in netgroup %s, skipping", hst, cp); + grp->gr_type = GT_IGNORE; } } else if (get_host(cp, grp, tgrp)) { - getexp_err(ep, tgrp); - goto nextline; + syslog(LOG_ERR, "Bad host %s, skipping", cp); + grp->gr_type = GT_IGNORE; } has_host = TRUE; } while (netgrp && getnetgrent(&hst, &usr, &dom)); @@ -916,6 +914,19 @@ get_exportlist() } else if ((opt_flags & OP_NET) && tgrp->gr_next) { getexp_err(ep, tgrp); goto nextline; + + /* + * If an export list was specified on this line, make sure + * that we have at least one valid entry, otherwise skip it. + */ + } else { + grp = tgrp; + while (grp && grp->gr_type == GT_IGNORE) + grp = grp->gr_next; + if (! grp) { + getexp_err(ep, tgrp); + goto nextline; + } } /* |