[SSSD] [PATCH] store original DN with cached group objects if available

Sumit Bose sbose at redhat.com
Fri Oct 23 11:57:25 UTC 2009


Hi,

with this patch the original DN of a group object is store in sysdb.
This is needed e.g. for IPA HBAC.

bye,
Sumit
-------------- next part --------------
>From 2466992484ad8d6838471208c5a1c3eb7968eaa5 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Fri, 23 Oct 2009 13:54:28 +0200
Subject: [PATCH] store original DN with cached group objects if available

---
 server/providers/ldap/sdap_async.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/server/providers/ldap/sdap_async.c b/server/providers/ldap/sdap_async.c
index 6350433..6b8790a 100644
--- a/server/providers/ldap/sdap_async.c
+++ b/server/providers/ldap/sdap_async.c
@@ -1648,6 +1648,22 @@ static struct tevent_req *sdap_save_group_send(TALLOC_CTX *memctx,
         goto fail;
     }
 
+    ret = sysdb_attrs_get_el(state->attrs, SYSDB_ORIG_DN, &el);
+    if (ret) {
+        goto fail;
+    }
+    if (el->num_values == 0) {
+        DEBUG(7, ("Original DN is not available for [%s].\n", state->name));
+    } else {
+        DEBUG(7, ("Adding original DN [%s] to attributes of [%s].\n",
+                  el->values[0].data, state->name));
+        ret = sysdb_attrs_add_string(group_attrs, SYSDB_ORIG_DN,
+                                     (const char *) el->values[0].data);
+        if (ret) {
+            goto fail;
+        }
+    }
+
     ret = sysdb_attrs_get_el(state->attrs,
                       opts->group_map[SDAP_AT_GROUP_MODSTAMP].sys_name, &el);
     if (ret) {
-- 
1.6.2.5



More information about the sssd-devel mailing list