diff options
author | wpaul <wpaul@FreeBSD.org> | 1998-06-25 21:26:06 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1998-06-25 21:26:06 +0000 |
commit | efe4f69151d02fcb79b2344c8d53805f146630da (patch) | |
tree | c2e3ed0f7712e3e604280c30a162a103379745f9 | |
parent | c18356075281bd45361256bb8e520a36eb9d3dd4 (diff) | |
download | FreeBSD-src-efe4f69151d02fcb79b2344c8d53805f146630da.zip FreeBSD-src-efe4f69151d02fcb79b2344c8d53805f146630da.tar.gz |
A long time ago I hacked mountd so that it would deal intelligently
with export lines where the same hostname was specified more than once
(this happens a lot with netgroups sometimes). Recently I discovered
that it needs to be hacked to deal with multiple instances of the
same IP address too.
I've been using this modification locally for several months with no
hassles.
-rw-r--r-- | sbin/mountd/mountd.c | 8 | ||||
-rw-r--r-- | usr.sbin/mountd/mountd.c | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c index a552ccc..2445d50 100644 --- a/sbin/mountd/mountd.c +++ b/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.29 1998/06/15 15:41:41 joerg Exp $"; + "$Id: mountd.c,v 1.30 1998/06/15 15:43:13 joerg Exp $"; #endif /*not lint*/ #include <sys/param.h> @@ -1483,10 +1483,12 @@ get_host(cp, grp, tgrp) * for this host in the grouplist. */ checkgrp = tgrp; - while (checkgrp) { + while (checkgrp != NULL) { if (checkgrp->gr_type == GT_HOST && checkgrp->gr_ptr.gt_hostent != NULL && - !strcmp(checkgrp->gr_ptr.gt_hostent->h_name, hp->h_name)) { + (!strcmp(checkgrp->gr_ptr.gt_hostent->h_name, hp->h_name) + || *(unsigned long *)checkgrp->gr_ptr.gt_hostent->h_addr == + *(unsigned long *)hp->h_addr)) { grp->gr_type = GT_IGNORE; return(0); } diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index a552ccc..2445d50 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.29 1998/06/15 15:41:41 joerg Exp $"; + "$Id: mountd.c,v 1.30 1998/06/15 15:43:13 joerg Exp $"; #endif /*not lint*/ #include <sys/param.h> @@ -1483,10 +1483,12 @@ get_host(cp, grp, tgrp) * for this host in the grouplist. */ checkgrp = tgrp; - while (checkgrp) { + while (checkgrp != NULL) { if (checkgrp->gr_type == GT_HOST && checkgrp->gr_ptr.gt_hostent != NULL && - !strcmp(checkgrp->gr_ptr.gt_hostent->h_name, hp->h_name)) { + (!strcmp(checkgrp->gr_ptr.gt_hostent->h_name, hp->h_name) + || *(unsigned long *)checkgrp->gr_ptr.gt_hostent->h_addr == + *(unsigned long *)hp->h_addr)) { grp->gr_type = GT_IGNORE; return(0); } |