Fix "sudo -l command args", broken in sudo 1.9.13.
The value of user_args should not contain the command to be run in "sudo -l command args", only the arguments of the command being checked. This restores the pre-1.9.13 behavior. GitHub issue #249
This commit is contained in:
@@ -1067,8 +1067,8 @@ display_cmnd(struct sudo_nss_list *snl, struct passwd *pw)
|
||||
break;
|
||||
}
|
||||
if (match == ALLOW) {
|
||||
/* For "sudo -l cmd" user_args includes the command being checked. */
|
||||
const int len = sudo_printf(SUDO_CONV_INFO_MSG, "%s\n", user_args);
|
||||
const int len = sudo_printf(SUDO_CONV_INFO_MSG, "%s%s%s\n",
|
||||
list_cmnd, user_args ? " " : "", user_args ? user_args : "");
|
||||
ret = len < 0 ? -1 : true;
|
||||
}
|
||||
debug_return_int(ret);
|
||||
|
Reference in New Issue
Block a user