summaryrefslogtreecommitdiffstats
path: root/src/util/find_uid.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2010-10-25 15:14:24 +0200
committerStephen Gallagher <sgallagh@redhat.com>2010-10-26 08:00:21 -0400
commit580374daba2ab2c6075a7d0de9512abff133e2e9 (patch)
treedfd9abe14efa5f6c79291ef72b1d2ac0b8326334 /src/util/find_uid.c
parent13147b598a8409c338abb9472e74bbd606f224bd (diff)
downloadsssd_unused-580374daba2ab2c6075a7d0de9512abff133e2e9.tar.gz
sssd_unused-580374daba2ab2c6075a7d0de9512abff133e2e9.tar.xz
sssd_unused-580374daba2ab2c6075a7d0de9512abff133e2e9.zip
Always use uint32_t for UID/GID numbers
Diffstat (limited to 'src/util/find_uid.c')
-rw-r--r--src/util/find_uid.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/find_uid.c b/src/util/find_uid.c
index 0937c664..e4d4ca8b 100644
--- a/src/util/find_uid.c
+++ b/src/util/find_uid.c
@@ -38,6 +38,7 @@
#include "dhash.h"
#include "util/util.h"
+#include "util/strtonum.h"
#define INITIAL_TABLE_SIZE 64
#define PATHLEN (NAME_MAX + 14)
@@ -63,7 +64,7 @@ static errno_t get_uid_from_pid(const pid_t pid, uid_t *uid)
char *p;
char *e;
char *endptr;
- unsigned long num=0;
+ uint32_t num=0;
errno_t error;
ret = snprintf(path, PATHLEN, "/proc/%d/status", pid);
@@ -131,8 +132,7 @@ static errno_t get_uid_from_pid(const pid_t pid, uid_t *uid)
} else {
*e = '\0';
}
- errno = 0;
- num = strtoul(p, &endptr, 10);
+ num = strtouint32(p, &endptr, 10);
error = errno;
if (error != 0) {
DEBUG(1, ("strtol failed [%s].\n", strerror(error)));