mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 06:15:37 +00:00
netgr_matches needs to check shost as well as host since they may be different.
This commit is contained in:
14
parse.c
14
parse.c
@@ -426,13 +426,14 @@ usergr_matches(group, user)
|
||||
|
||||
/*
|
||||
* Returns TRUE if "host" and "user" belong to the netgroup "netgr",
|
||||
* else return FALSE. Either of "host" or "user" may be NULL
|
||||
* else return FALSE. Either of "host", "shost" or "user" may be NULL
|
||||
* in which case that argument is not checked...
|
||||
*/
|
||||
int
|
||||
netgr_matches(netgr, host, user)
|
||||
netgr_matches(netgr, host, shost, user)
|
||||
char *netgr;
|
||||
char *host;
|
||||
char *shost;
|
||||
char *user;
|
||||
{
|
||||
#ifdef HAVE_GETDOMAINNAME
|
||||
@@ -457,10 +458,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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user