summaryrefslogtreecommitdiff
path: root/usr.bin/sudo/testsudoers.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2000-01-24 04:22:55 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2000-01-24 04:22:55 +0000
commitd461006d249b4d292b92c585af010fa062af3fdd (patch)
treec2b97f3821188c54aec80450330f94b55b01aefd /usr.bin/sudo/testsudoers.c
parentb215148bbe6aa9229213a6b82976a820d70c161d (diff)
sudo 1.6.2
Diffstat (limited to 'usr.bin/sudo/testsudoers.c')
-rw-r--r--usr.bin/sudo/testsudoers.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.bin/sudo/testsudoers.c b/usr.bin/sudo/testsudoers.c
index 0a5485e13dc..0e32a2a542b 100644
--- a/usr.bin/sudo/testsudoers.c
+++ b/usr.bin/sudo/testsudoers.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1998, 1999 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1996, 1998-2000 Todd C. Miller <Todd.Miller@courtesan.com>
* All rights reserved.
*
* This code is derived from software contributed by Chris Jepeway
@@ -77,7 +77,7 @@
#endif /* HAVE_FNMATCH */
#ifndef lint
-static const char rcsid[] = "$Sudo: testsudoers.c,v 1.66 1999/12/09 03:54:57 millert Exp $";
+static const char rcsid[] = "$Sudo: testsudoers.c,v 1.68 2000/01/17 23:46:26 millert Exp $";
#endif /* lint */
/*
@@ -240,9 +240,10 @@ usergr_matches(group, user)
}
int
-netgr_matches(netgr, host, user)
+netgr_matches(netgr, host, shost, user)
char *netgr;
char *host;
+ char *shost;
char *user;
{
#ifdef HAVE_GETDOMAINNAME
@@ -268,10 +269,13 @@ netgr_matches(netgr, host, user)
#endif /* HAVE_GETDOMAINNAME */
#ifdef HAVE_INNETGR
- return(innetgr(netgr, host, user, domain));
-#else
- return(FALSE);
+ if (innetgr(netgr, host, user, domain))
+ return(TRUE);
+ else if (host != shost && innetgr(netgr, shost, user, domain))
+ return(TRUE);
#endif /* HAVE_INNETGR */
+
+ return(FALSE);
}
void