diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2013-01-06 16:04:32 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-01-09 18:01:29 +0100 |
commit | 3a7ad750232322b705da8d3a5ef196f61d47075c (patch) | |
tree | b8200eb3743c12280c161d539c0169c58c5b5a1e /src/providers/ldap/sdap_async_users.c | |
parent | 77064ac939f0aff2bf21b31ef01ab3c3427b4b2e (diff) | |
download | sssd-3a7ad750232322b705da8d3a5ef196f61d47075c.tar.gz sssd-3a7ad750232322b705da8d3a5ef196f61d47075c.tar.xz sssd-3a7ad750232322b705da8d3a5ef196f61d47075c.zip |
AD: replace GID/UID, do not add another one
The code would call sysdb_attrs_add_uint32 which added another UID or GID
to the ID=0 we already downloaded from LDAP (0 is the default value) when
ID-mapping an entry. This led to funky behaviour later on when we wanted
to process the ID.
Diffstat (limited to 'src/providers/ldap/sdap_async_users.c')
-rw-r--r-- | src/providers/ldap/sdap_async_users.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/providers/ldap/sdap_async_users.c b/src/providers/ldap/sdap_async_users.c index f640b970a..ade1d37b5 100644 --- a/src/providers/ldap/sdap_async_users.c +++ b/src/providers/ldap/sdap_async_users.c @@ -160,8 +160,11 @@ int sdap_save_user(TALLOC_CTX *memctx, /* Store the UID in the ldap_attrs so it doesn't get * treated as a missing attribute from LDAP and removed. */ - ret = sysdb_attrs_add_uint32(attrs, SYSDB_UIDNUM, uid); - if (ret != EOK) goto done; + ret = sdap_replace_id(attrs, SYSDB_UIDNUM, uid); + if (ret) { + DEBUG(SSSDBG_OP_FAILURE, ("Cannot set the id-mapped UID\n")); + goto done; + } } else { ret = sysdb_attrs_get_uint32_t(attrs, opts->user_map[SDAP_AT_USER_UID].sys_name, |