summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2012-02-29 10:37:41 -0500
committerJakub Hrozek <jhrozek@redhat.com>2015-03-19 16:44:23 +0100
commita471b7def3bed010ab60c39cc5201ea0089409a2 (patch)
tree2814a534eee6d5e5775d13d1c09cdd7f65f00026
parent2d9bcb6249d74f7a2bb259e5da39646ec8913955 (diff)
downloadsssd-a471b7def3bed010ab60c39cc5201ea0089409a2.tar.gz
sssd-a471b7def3bed010ab60c39cc5201ea0089409a2.tar.xz
sssd-a471b7def3bed010ab60c39cc5201ea0089409a2.zip
Handle cases where UID is -1rhel5.10
Also removes an unnecessary range check (since it's already handled by strtoint32() https://fedorahosted.org/sssd/ticket/1216 (cherry picked from commit f5df473c0234bf4b701a29f4feb61ad52f70b236)
-rw-r--r--src/util/find_uid.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/util/find_uid.c b/src/util/find_uid.c
index e4d4ca8be..22cf47c02 100644
--- a/src/util/find_uid.c
+++ b/src/util/find_uid.c
@@ -132,7 +132,7 @@ static errno_t get_uid_from_pid(const pid_t pid, uid_t *uid)
} else {
*e = '\0';
}
- num = strtouint32(p, &endptr, 10);
+ num = (uint32_t) strtoint32(p, &endptr, 10);
error = errno;
if (error != 0) {
DEBUG(1, ("strtol failed [%s].\n", strerror(error)));
@@ -143,11 +143,6 @@ static errno_t get_uid_from_pid(const pid_t pid, uid_t *uid)
return EINVAL;
}
- if (num >= UINT32_MAX) {
- DEBUG(1, ("uid out of range.\n"));
- return ERANGE;
- }
-
} else {
DEBUG(1, ("format error\n"));
return EINVAL;