mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 14:25:15 +00:00
Each entry in a cmndlist now has an associated runaslist
so no need to keep track of the most recent non-NULL one.
This commit is contained in:
12
parse.c
12
parse.c
@@ -87,7 +87,6 @@ sudoers_lookup(pwflag)
|
||||
int validated, match, host_match, runas_match, cmnd_match;
|
||||
struct cmndspec *cs;
|
||||
struct cmndtag *tags = NULL;
|
||||
struct member_list *runas;
|
||||
struct privilege *priv;
|
||||
struct userspec *us;
|
||||
|
||||
@@ -157,11 +156,8 @@ sudoers_lookup(pwflag)
|
||||
CLR(validated, FLAG_NO_HOST);
|
||||
else
|
||||
continue;
|
||||
runas = NULL;
|
||||
lh_foreach_rev(&priv->cmndlist, cs) {
|
||||
if (!lh_empty(&cs->runaslist))
|
||||
runas = &cs->runaslist;
|
||||
runas_match = runaslist_matches(runas);
|
||||
runas_match = runaslist_matches(&cs->runaslist);
|
||||
if (runas_match == ALLOW) {
|
||||
cmnd_match = cmnd_matches(cs->cmnd);
|
||||
if (cmnd_match != UNSPEC) {
|
||||
@@ -422,7 +418,6 @@ display_cmnd(v, pw)
|
||||
{
|
||||
struct cmndspec *cs;
|
||||
struct member *match;
|
||||
struct member_list *runas;
|
||||
struct privilege *priv;
|
||||
struct userspec *us;
|
||||
int rval = 1;
|
||||
@@ -442,11 +437,8 @@ display_cmnd(v, pw)
|
||||
host_match = hostlist_matches(&priv->hostlist);
|
||||
if (host_match != ALLOW)
|
||||
continue;
|
||||
runas = NULL;
|
||||
lh_foreach_rev(&priv->cmndlist, cs) {
|
||||
if (!lh_empty(&cs->runaslist) != NULL)
|
||||
runas = &cs->runaslist;
|
||||
runas_match = runaslist_matches(runas);
|
||||
runas_match = runaslist_matches(&cs->runaslist);
|
||||
if (runas_match == ALLOW) {
|
||||
cmnd_match = cmnd_matches(cs->cmnd);
|
||||
if (cmnd_match != UNSPEC) {
|
||||
|
Reference in New Issue
Block a user