mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-10 08:22:27 +01:00
Watch out for null hostnames in netgroup entries, to avoid dumping core.
This happens if someone tries to export to a netgroup like: mygroup (,,mynisdomain)
This commit is contained in:
parent
f67d01d564
commit
9d70a1569c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=37003
@ -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.27 1997/12/13 19:50:14 guido Exp $";
|
||||
"$Id: mountd.c,v 1.28 1998/01/20 15:22:27 bde Exp $";
|
||||
#endif /*not lint*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -913,7 +913,9 @@ get_exportlist()
|
||||
grp = grp->gr_next;
|
||||
}
|
||||
if (netgrp) {
|
||||
if (get_host(hst, grp, tgrp)) {
|
||||
if (hst == 0) {
|
||||
syslog(LOG_ERR, "Null hostname in netgroup %s, skipping", cp);
|
||||
} else if (get_host(hst, grp, tgrp)) {
|
||||
syslog(LOG_ERR, "Bad host %s in netgroup %s, skipping", hst, cp);
|
||||
grp->gr_type = GT_IGNORE;
|
||||
}
|
||||
|
@ -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.27 1997/12/13 19:50:14 guido Exp $";
|
||||
"$Id: mountd.c,v 1.28 1998/01/20 15:22:27 bde Exp $";
|
||||
#endif /*not lint*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -913,7 +913,9 @@ get_exportlist()
|
||||
grp = grp->gr_next;
|
||||
}
|
||||
if (netgrp) {
|
||||
if (get_host(hst, grp, tgrp)) {
|
||||
if (hst == 0) {
|
||||
syslog(LOG_ERR, "Null hostname in netgroup %s, skipping", cp);
|
||||
} else if (get_host(hst, grp, tgrp)) {
|
||||
syslog(LOG_ERR, "Bad host %s in netgroup %s, skipping", hst, cp);
|
||||
grp->gr_type = GT_IGNORE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user