summaryrefslogtreecommitdiff
path: root/src/providers/proxy
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2010-10-15 15:57:10 +0200
committerStephen Gallagher <sgallagh@redhat.com>2010-10-18 13:12:04 -0400
commit27c67307976a60088ca301e07404bdb52740c3af (patch)
tree698c9331ad91cd71687055f3cf4951dbc5a755b3 /src/providers/proxy
parentd80a670c94e5a0e21702b8cd8ac5a66fbba81178 (diff)
downloadsssd-27c67307976a60088ca301e07404bdb52740c3af.tar.gz
sssd-27c67307976a60088ca301e07404bdb52740c3af.tar.bz2
sssd-27c67307976a60088ca301e07404bdb52740c3af.zip
Use unsigned long for conversion to id_t
We used strtol() on a number of places to convert into uid_t or gid_t from a string representation such as LDAP attribute, but on some platforms, unsigned long might be necessary to store big id_t values. This patch converts to using strtoul() instead.
Diffstat (limited to 'src/providers/proxy')
-rw-r--r--src/providers/proxy/proxy_id.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/providers/proxy/proxy_id.c b/src/providers/proxy/proxy_id.c
index ab2be353..3fe58f3a 100644
--- a/src/providers/proxy/proxy_id.c
+++ b/src/providers/proxy/proxy_id.c
@@ -1078,7 +1078,7 @@ void proxy_get_account_info(struct be_req *breq)
} else {
char *endptr;
errno = 0;
- uid = (uid_t)strtol(ar->filter_value, &endptr, 0);
+ uid = (uid_t) strtoul(ar->filter_value, &endptr, 0);
if (errno || *endptr || (ar->filter_value == endptr)) {
return proxy_reply(breq, DP_ERR_FATAL,
EINVAL, "Invalid attr type");
@@ -1108,7 +1108,7 @@ void proxy_get_account_info(struct be_req *breq)
} else {
char *endptr;
errno = 0;
- gid = (gid_t)strtol(ar->filter_value, &endptr, 0);
+ gid = (gid_t) strtoul(ar->filter_value, &endptr, 0);
if (errno || *endptr || (ar->filter_value == endptr)) {
return proxy_reply(breq, DP_ERR_FATAL,
EINVAL, "Invalid attr type");