[SSSD] [PATCH] GPO: error out instead of leaving array element uninitialized

Sumit Bose sbose at redhat.com
Fri Mar 20 17:47:09 UTC 2015


Hi,

this patch should fix a segfault which was recently found in the GPO
code.

bye,
Sumit
-------------- next part --------------
From 6b3dc8dc3976e1b962478394c41a17c230601527 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Fri, 20 Mar 2015 18:41:52 +0100
Subject: [PATCH] GPO: error out instead of leaving array element uninitialized

In general every object created by the AD provider should have a SID
attribute. Since SIDs and GPOs are used for access control a missing SID
should be treated as error for now until it is known if there is a valid
reason why the SID is missing.

Resolves https://fedorahosted.org/sssd/ticket/2608
---
 src/providers/ad/ad_gpo.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/providers/ad/ad_gpo.c b/src/providers/ad/ad_gpo.c
index a9879b41b6b618d4c73156d95378c9bcd2b397c4..ecb65a8cf22879c9833f3ee6c57a6fc5247a402e 100644
--- a/src/providers/ad/ad_gpo.c
+++ b/src/providers/ad/ad_gpo.c
@@ -581,7 +581,10 @@ ad_gpo_get_sids(TALLOC_CTX *mem_ctx,
         group_sid = ldb_msg_find_attr_as_string(res->msgs[i+1],
                                                 SYSDB_SID_STR, NULL);
         if (group_sid == NULL) {
-            continue;
+            DEBUG(SSSDBG_CRIT_FAILURE, "Missing SID for cache entry [%s].\n",
+                  ldb_dn_get_linearized(res->msgs[i+1]->dn));
+            ret = EINVAL;
+            goto done;
         }
 
         group_sids[i] = talloc_steal(group_sids, group_sid);
-- 
2.1.0



More information about the sssd-devel mailing list