Better error message when failing to list another user's entries.
(void) fprintf(stderr,
"Sorry, user %s is not allowed to execute '%s%s%s' as %s on %s.\n",
user_name, user_cmnd, user_args ? " " : "",
- user_args ? user_args : "", *user_runas, user_host);
+ user_args ? user_args : "",
+ list_pw ? list_pw->pw_name : *user_runas, user_host);
}
/*
for (cs = priv->cmndlist; cs != NULL; cs = cs->next) {
/* Only check the command when listing another user. */
if (user_uid == 0 || list_pw == NULL ||
+ user_uid == list_pw->pw_uid ||
cmnd_matches(user_cmnd, user_args, cs->cmnd) == TRUE)
matched = TRUE;
if ((pwcheck == any && nopass != TRUE) ||