From 8b66b61169ddee4883361e702be6ef1f48a3c1a7 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 17 Jun 1996 16:16:11 +0000 Subject: [PATCH] fixed -u support with multiple user lists on a line --- parse.c | 3 +-- parse.yacc | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/parse.c b/parse.c index 1316ccb58..7e7cc01b5 100644 --- a/parse.c +++ b/parse.c @@ -153,8 +153,7 @@ int validate(check_cmnd) while (top) { if (host_matches == TRUE) if (cmnd_matches == TRUE) - if ((runas_matches == TRUE) || - (runas_matches != FALSE && !strcmp(runas_user, "root"))) + if (runas_matches == TRUE) /* * User was granted access to cmnd on host. * If no passwd required return as such. diff --git a/parse.yacc b/parse.yacc index 727a023ba..44d30f436 100644 --- a/parse.yacc +++ b/parse.yacc @@ -233,7 +233,7 @@ opcmndlist : opcmnd | opcmndlist ',' opcmnd ; -opcmnd : cmnd { ; } +opcmnd : cmnd { runas_matches = TRUE; } | '!' { if (printmatches == TRUE && host_matches == TRUE && user_matches == TRUE) { @@ -259,8 +259,6 @@ opcmnd : cmnd { ; } runasspec : RUNAS runaslist chkcmnd { if ($2 > 0 && $3 == TRUE) runas_matches = TRUE; - else - runas_matches = FALSE; } runaslist : runasuser { -- 2.49.0