When matching for "sudoedit" in sudoers check both the command the user
typed *and* the command that is listed in the sudoers entry.
This commit is contained in:
2
parse.c
2
parse.c
@@ -249,7 +249,7 @@ command_matches(cmnd, cmnd_args, path, sudoers_args)
|
|||||||
* b) there are no args on command line and none req by sudoers OR
|
* b) there are no args on command line and none req by sudoers OR
|
||||||
* c) there are args in sudoers and on command line and they match
|
* c) there are args in sudoers and on command line and they match
|
||||||
*/
|
*/
|
||||||
if (strcmp(cmnd, "sudoedit") != 0)
|
if (strcmp(cmnd, "sudoedit") != 0 || strcmp(path, "sudoedit") != 0)
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
if (!sudoers_args ||
|
if (!sudoers_args ||
|
||||||
(!cmnd_args && sudoers_args && !strcmp("\"\"", sudoers_args)) ||
|
(!cmnd_args && sudoers_args && !strcmp("\"\"", sudoers_args)) ||
|
||||||
|
Reference in New Issue
Block a user