Fix matching of uids and gids broken in sudo 1.8.9.

This commit is contained in:
Todd C. Miller
2014-04-09 10:22:09 -06:00
parent ecae6b4f9a
commit 27aff732f1
6 changed files with 48 additions and 2 deletions

View File

@@ -802,7 +802,7 @@ userpw_matches(const char *sudoers_user, const char *user, const struct passwd *
if (pw != NULL && *sudoers_user == '#') {
uid = (uid_t) atoid(sudoers_user + 1, NULL, NULL, &errstr);
if (errstr != NULL && uid == pw->pw_uid) {
if (errstr == NULL && uid == pw->pw_uid) {
rc = true;
goto done;
}
@@ -829,7 +829,7 @@ group_matches(const char *sudoers_group, const struct group *gr)
if (*sudoers_group == '#') {
gid = (gid_t) atoid(sudoers_group + 1, NULL, NULL, &errstr);
if (errstr != NULL && gid == gr->gr_gid) {
if (errstr == NULL && gid == gr->gr_gid) {
rc = true;
goto done;
}