summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/sdap_async_accounts.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/providers/ldap/sdap_async_accounts.c
parent13147b598a8409c338abb9472e74bbd606f224bd (diff)
downloadsssd-580374daba2ab2c6075a7d0de9512abff133e2e9.tar.gz
sssd-580374daba2ab2c6075a7d0de9512abff133e2e9.tar.xz
sssd-580374daba2ab2c6075a7d0de9512abff133e2e9.zip
Always use uint32_t for UID/GID numbers
Diffstat (limited to 'src/providers/ldap/sdap_async_accounts.c')
-rw-r--r--src/providers/ldap/sdap_async_accounts.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/providers/ldap/sdap_async_accounts.c b/src/providers/ldap/sdap_async_accounts.c
index 62bafed43..6b14161ce 100644
--- a/src/providers/ldap/sdap_async_accounts.c
+++ b/src/providers/ldap/sdap_async_accounts.c
@@ -43,7 +43,6 @@ static int sdap_save_user(TALLOC_CTX *memctx,
const char *gecos;
const char *homedir;
const char *shell;
- unsigned long l;
uid_t uid;
gid_t gid;
struct sysdb_attrs *user_attrs;
@@ -90,16 +89,15 @@ static int sdap_save_user(TALLOC_CTX *memctx,
if (el->num_values == 0) shell = NULL;
else shell = (const char *)el->values[0].data;
- ret = sysdb_attrs_get_ulong(attrs,
- opts->user_map[SDAP_AT_USER_UID].sys_name,
- &l);
+ ret = sysdb_attrs_get_uint32_t(attrs,
+ opts->user_map[SDAP_AT_USER_UID].sys_name,
+ &uid);
if (ret != EOK) {
DEBUG(1, ("no uid provided for [%s] in domain [%s].\n",
name, dom->name));
ret = EINVAL;
goto fail;
}
- uid = l;
/* check that the uid is valid for this domain */
if (OUT_OF_ID_RANGE(uid, dom->id_min, dom->id_max)) {
@@ -109,16 +107,15 @@ static int sdap_save_user(TALLOC_CTX *memctx,
goto fail;
}
- ret = sysdb_attrs_get_ulong(attrs,
- opts->user_map[SDAP_AT_USER_GID].sys_name,
- &l);
+ ret = sysdb_attrs_get_uint32_t(attrs,
+ opts->user_map[SDAP_AT_USER_GID].sys_name,
+ &gid);
if (ret != EOK) {
DEBUG(1, ("no gid provided for [%s] in domain [%s].\n",
name, dom->name));
ret = EINVAL;
goto fail;
}
- gid = l;
/* check that the gid is valid for this domain */
if (OUT_OF_ID_RANGE(gid, dom->id_min, dom->id_max)) {
@@ -609,7 +606,6 @@ static int sdap_save_group(TALLOC_CTX *memctx,
struct ldb_message_element *el;
struct sysdb_attrs *group_attrs;
const char *name = NULL;
- unsigned long l;
gid_t gid;
int ret;
char *timestamp = NULL;
@@ -623,16 +619,15 @@ static int sdap_save_group(TALLOC_CTX *memctx,
}
name = (const char *)el->values[0].data;
- ret = sysdb_attrs_get_ulong(attrs,
- opts->group_map[SDAP_AT_GROUP_GID].sys_name,
- &l);
+ ret = sysdb_attrs_get_uint32_t(attrs,
+ opts->group_map[SDAP_AT_GROUP_GID].sys_name,
+ &gid);
if (ret != EOK) {
DEBUG(1, ("no gid provided for [%s] in domain [%s].\n",
name, dom->name));
ret = EINVAL;
goto fail;
}
- gid = l;
/* check that the gid is valid for this domain */
if (OUT_OF_ID_RANGE(gid, dom->id_min, dom->id_max)) {
@@ -1792,9 +1787,9 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
}
if (strcmp(name, missing[i]) == 0) {
- ret = sysdb_attrs_get_ulong(ldap_groups[ai],
- SYSDB_GIDNUM,
- (unsigned long *) &gid);
+ ret = sysdb_attrs_get_uint32_t(ldap_groups[ai],
+ SYSDB_GIDNUM,
+ &gid);
if (ret) {
DEBUG(1, ("The GID attribute is missing or malformed\n"));
goto fail;