summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2012-02-29 10:37:41 -0500
committerStephen Gallagher <sgallagh@redhat.com>2012-02-29 13:52:17 -0500
commitf5df473c0234bf4b701a29f4feb61ad52f70b236 (patch)
tree5961a830eded328eb97fc3c7cf360a7e899dae77 /src
parenta271a3f7c1a9fe1da7f039fd1a3365b1d6f351ba (diff)
downloadsssd-f5df473c0234bf4b701a29f4feb61ad52f70b236.tar.gz
sssd-f5df473c0234bf4b701a29f4feb61ad52f70b236.tar.xz
sssd-f5df473c0234bf4b701a29f4feb61ad52f70b236.zip
Handle cases where UID is -1
Also removes an unnecessary range check (since it's already handled by strtoint32() https://fedorahosted.org/sssd/ticket/1216
Diffstat (limited to 'src')
-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 f4156ce76..77b9f22a8 100644
--- a/src/util/find_uid.c
+++ b/src/util/find_uid.c
@@ -137,7 +137,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)));
@@ -148,11 +148,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;