From 580374daba2ab2c6075a7d0de9512abff133e2e9 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Mon, 25 Oct 2010 15:14:24 +0200 Subject: Always use uint32_t for UID/GID numbers --- src/providers/proxy/proxy_id.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/providers/proxy/proxy_id.c') diff --git a/src/providers/proxy/proxy_id.c b/src/providers/proxy/proxy_id.c index ff3ddf803..35fc9c492 100644 --- a/src/providers/proxy/proxy_id.c +++ b/src/providers/proxy/proxy_id.c @@ -22,6 +22,7 @@ along with this program. If not, see . */ +#include "util/strtonum.h" #include "providers/proxy/proxy.h" /* =Getpwnam-wrapper======================================================*/ @@ -1077,8 +1078,7 @@ void proxy_get_account_info(struct be_req *breq) EINVAL, "Invalid attr type"); } else { char *endptr; - errno = 0; - uid = (uid_t) strtoul(ar->filter_value, &endptr, 0); + uid = (uid_t) strtouint32(ar->filter_value, &endptr, 0); if (errno || *endptr || (ar->filter_value == endptr)) { return proxy_reply(breq, DP_ERR_FATAL, EINVAL, "Invalid attr type"); @@ -1107,8 +1107,7 @@ void proxy_get_account_info(struct be_req *breq) EINVAL, "Invalid attr type"); } else { char *endptr; - errno = 0; - gid = (gid_t) strtoul(ar->filter_value, &endptr, 0); + gid = (gid_t) strtouint32(ar->filter_value, &endptr, 0); if (errno || *endptr || (ar->filter_value == endptr)) { return proxy_reply(breq, DP_ERR_FATAL, EINVAL, "Invalid attr type"); -- cgit