Rename sudo_strtoid() to sudo_strtoidx() and add simplified sudo_strtoid()

This commit is contained in:
Todd C. Miller
2019-10-20 10:21:29 -06:00
parent 6260bf60b4
commit 40bf4081be
21 changed files with 71 additions and 52 deletions

View File

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