diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2010-10-25 14:57:35 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-10-26 08:01:43 -0400 |
commit | 4228c4d88c1be62542a532dbd295317dbb9f6ce3 (patch) | |
tree | f08bdebd330888cb2096d46d37f2d3806c92c6fa /src/providers/ldap/ldap_id.c | |
parent | 59216d82123688ae360757bf8c5eb77236555416 (diff) | |
download | sssd2-4228c4d88c1be62542a532dbd295317dbb9f6ce3.tar.gz sssd2-4228c4d88c1be62542a532dbd295317dbb9f6ce3.tar.xz sssd2-4228c4d88c1be62542a532dbd295317dbb9f6ce3.zip |
Always use uint32_t for UID/GID numbers
Diffstat (limited to 'src/providers/ldap/ldap_id.c')
-rw-r--r-- | src/providers/ldap/ldap_id.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/providers/ldap/ldap_id.c b/src/providers/ldap/ldap_id.c index 5a9f5755..5cf593db 100644 --- a/src/providers/ldap/ldap_id.c +++ b/src/providers/ldap/ldap_id.c @@ -27,6 +27,7 @@ #include <sys/time.h> #include "util/util.h" +#include "util/strtonum.h" #include "db/sysdb.h" #include "providers/ldap/ldap_common.h" #include "providers/ldap/sdap_async.h" @@ -200,10 +201,9 @@ static void users_get_done(struct tevent_req *subreq) return; case BE_FILTER_IDNUM: - errno = 0; - uid = (uid_t) strtoul(state->name, &endptr, 0); + uid = (uid_t) strtouint32(state->name, &endptr, 0); if (errno || *endptr || (state->name == endptr)) { - tevent_req_error(req, errno); + tevent_req_error(req, errno ? errno : EINVAL); return; } @@ -421,10 +421,9 @@ static void groups_get_done(struct tevent_req *subreq) return; case BE_FILTER_IDNUM: - errno = 0; - gid = (gid_t) strtoul(state->name, &endptr, 0); + gid = (gid_t) strtouint32(state->name, &endptr, 0); if (errno || *endptr || (state->name == endptr)) { - tevent_req_error(req, errno); + tevent_req_error(req, errno ? errno : EINVAL); return; } |