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:
Todd C. Miller
2004-07-08 00:15:37 +00:00
parent 5e8d3f8f26
commit a6fe34784a

View File

@@ -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
* 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);
if (!sudoers_args ||
(!cmnd_args && sudoers_args && !strcmp("\"\"", sudoers_args)) ||