From f9f74a587c8e96dcf90214c760022684afc8bef7 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Sun, 6 Jan 2013 16:04:32 +0100 Subject: 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. --- src/providers/ldap/sdap_async_groups.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/providers/ldap/sdap_async_groups.c') diff --git a/src/providers/ldap/sdap_async_groups.c b/src/providers/ldap/sdap_async_groups.c index 26f36fb9..e1e84c33 100644 --- a/src/providers/ldap/sdap_async_groups.c +++ b/src/providers/ldap/sdap_async_groups.c @@ -398,11 +398,9 @@ static int sdap_save_group(TALLOC_CTX *memctx, /* Store the GID 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_GIDNUM, gid); - if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not store GID: [%s]\n", - strerror(ret))); + ret = sdap_replace_id(attrs, SYSDB_GIDNUM, gid); + if (ret) { + DEBUG(SSSDBG_OP_FAILURE, ("Cannot set the id-mapped GID\n")); goto done; } } else { -- cgit