Hi,

I was looking into the remaining downstream test failures and found this
bug caused by the FQDN patchset..
>From df82480e68ac31f97e504c56917e1dbe083950cb Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhro...@redhat.com>
Date: Fri, 8 Jul 2016 13:19:31 +0200
Subject: [PATCH] LDAP: Fix storing initgroups for users with no supplementary
 groups

If there are no supplementary groups, we tried to qualify a NULL pointer
to an array which resulted in an error.
---
 src/providers/ldap/sdap_async_initgroups.c | 32 +++++++++++++++++-------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/src/providers/ldap/sdap_async_initgroups.c 
b/src/providers/ldap/sdap_async_initgroups.c
index 
d14563cb045a0ce34b72051744894362fc32d003..40471d6a216a593ea16e7b6caa1ab4d7243101e6
 100644
--- a/src/providers/ldap/sdap_async_initgroups.c
+++ b/src/providers/ldap/sdap_async_initgroups.c
@@ -301,13 +301,15 @@ int sdap_initgr_common_store(struct sysdb_ctx *sysdb,
     /* Find the differences between the sysdb and LDAP lists
      * Groups in the sysdb only must be removed.
      */
-    ldap_fqdnlist = sss_create_internal_fqname_list(
-                                        tmp_ctx,
-                                        (const char * const *) ldap_grouplist,
-                                        domain->name);
-    if (ldap_fqdnlist == NULL) {
-        ret = ENOMEM;
-        goto done;
+    if (ldap_grouplist != NULL) {
+        ldap_fqdnlist = sss_create_internal_fqname_list(
+                                            tmp_ctx,
+                                            (const char * const *) 
ldap_grouplist,
+                                            domain->name);
+        if (ldap_fqdnlist == NULL) {
+            ret = ENOMEM;
+            goto done;
+        }
     }
 
     ret = diff_string_lists(tmp_ctx, ldap_fqdnlist, sysdb_grouplist,
@@ -1288,13 +1290,15 @@ sdap_initgr_store_user_memberships(struct 
sdap_initgr_nested_state *state)
         }
     }
 
-    ldap_fqdnlist = sss_create_internal_fqname_list(
-                                tmp_ctx,
-                                (const char * const *) ldap_parent_name_list,
-                                state->dom->name);
-    if (ldap_fqdnlist == NULL) {
-        ret = ENOMEM;
-        goto done;
+    if (ldap_parent_name_list) {
+        ldap_fqdnlist = sss_create_internal_fqname_list(
+                                  tmp_ctx,
+                                  (const char * const *) ldap_parent_name_list,
+                                  state->dom->name);
+        if (ldap_fqdnlist == NULL) {
+            ret = ENOMEM;
+            goto done;
+        }
     }
 
     ret = sysdb_get_direct_parents(tmp_ctx, state->dom, SYSDB_MEMBER_USER,
-- 
2.4.11

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

Reply via email to