While reviewing Jan's sysdb patches I noticed that a call to
sysdb_attrs_add_uint32() I added recently is wrong.

The reason the code worked and the compiler did not complain was simple
- there's only one place that calls sdap_store_group_with_gid() and it
passes group_attrs for mem_ctx. If we ever reused
sdap_store_group_with_gid() with a different memory context it would
probably crash and burn.

Sorry about the inconvenience.
From 5989679bc934b7fc6665826473ffee00b4ab33fb Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhro...@redhat.com>
Date: Thu, 28 Jul 2011 17:51:37 +0200
Subject: [PATCH] Wrong paramater to sysdb_attrs_add_uint32

---
 src/providers/ldap/sdap_async_accounts.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/providers/ldap/sdap_async_accounts.c b/src/providers/ldap/sdap_async_accounts.c
index 581abc6..40e1215 100644
--- a/src/providers/ldap/sdap_async_accounts.c
+++ b/src/providers/ldap/sdap_async_accounts.c
@@ -678,7 +678,7 @@ sdap_store_group_with_gid(TALLOC_CTX *mem_ctx,
     /* make sure that non-posix (empty or explicit gid=0) groups have the
      * gidNumber set to zero even if updating existing group */
     if (!posix_group) {
-        ret = sysdb_attrs_add_uint32(mem_ctx, SYSDB_GIDNUM, 0);
+        ret = sysdb_attrs_add_uint32(group_attrs, SYSDB_GIDNUM, 0);
         if (ret) {
             DEBUG(2, ("Could not set explicit GID 0 for %s\n", name));
             return ret;
-- 
1.7.6

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to