|
|
b2d430 |
From bfbad5b20c8a34b545cea8df6c937125edf0e42c Mon Sep 17 00:00:00 2001
|
|
|
b2d430 |
From: =?UTF-8?q?Michal=20=C5=BDidek?= <mzidek@redhat.com>
|
|
|
b2d430 |
Date: Wed, 7 Sep 2016 10:58:25 +0200
|
|
|
b2d430 |
Subject: [PATCH 131/135] TOOLS: use internal fqdn for DN
|
|
|
b2d430 |
MIME-Version: 1.0
|
|
|
b2d430 |
Content-Type: text/plain; charset=UTF-8
|
|
|
b2d430 |
Content-Transfer-Encoding: 8bit
|
|
|
b2d430 |
|
|
|
b2d430 |
Use internal fqdn when creating sysdb group dn.
|
|
|
b2d430 |
|
|
|
b2d430 |
Resolves:
|
|
|
b2d430 |
https://fedorahosted.org/sssd/ticket/3178
|
|
|
b2d430 |
|
|
|
b2d430 |
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
|
|
|
b2d430 |
(cherry picked from commit 5e2142b66589e5e50cb404fc972ed5418bbaa772)
|
|
|
b2d430 |
---
|
|
|
b2d430 |
src/tools/sss_sync_ops.c | 11 ++++++++++-
|
|
|
b2d430 |
1 file changed, 10 insertions(+), 1 deletion(-)
|
|
|
b2d430 |
|
|
|
b2d430 |
diff --git a/src/tools/sss_sync_ops.c b/src/tools/sss_sync_ops.c
|
|
|
b2d430 |
index 39ef5bec96bd3942da8a8adfd21c99b03a77e551..a0291baeada49b9f21e040a54e303214d5a46332 100644
|
|
|
b2d430 |
--- a/src/tools/sss_sync_ops.c
|
|
|
b2d430 |
+++ b/src/tools/sss_sync_ops.c
|
|
|
b2d430 |
@@ -137,6 +137,7 @@ static int mod_groups_member(struct sss_domain_info *dom,
|
|
|
b2d430 |
struct ldb_dn *parent_dn;
|
|
|
b2d430 |
int ret;
|
|
|
b2d430 |
int i;
|
|
|
b2d430 |
+ char *grp_sysdb_fqname = NULL;
|
|
|
b2d430 |
|
|
|
b2d430 |
tmpctx = talloc_new(NULL);
|
|
|
b2d430 |
if (!tmpctx) {
|
|
|
b2d430 |
@@ -145,13 +146,21 @@ static int mod_groups_member(struct sss_domain_info *dom,
|
|
|
b2d430 |
|
|
|
b2d430 |
/* FIXME: add transaction around loop */
|
|
|
b2d430 |
for (i = 0; grouplist[i]; i++) {
|
|
|
b2d430 |
+ grp_sysdb_fqname = sss_create_internal_fqname(tmpctx, grouplist[i],
|
|
|
b2d430 |
+ dom->name);
|
|
|
b2d430 |
+ if (grp_sysdb_fqname == NULL) {
|
|
|
b2d430 |
+ ret = ENOMEM;
|
|
|
b2d430 |
+ goto done;
|
|
|
b2d430 |
+ }
|
|
|
b2d430 |
|
|
|
b2d430 |
- parent_dn = sysdb_group_dn(tmpctx, dom, grouplist[i]);
|
|
|
b2d430 |
+ parent_dn = sysdb_group_dn(tmpctx, dom, grp_sysdb_fqname);
|
|
|
b2d430 |
if (!parent_dn) {
|
|
|
b2d430 |
ret = ENOMEM;
|
|
|
b2d430 |
goto done;
|
|
|
b2d430 |
}
|
|
|
b2d430 |
|
|
|
b2d430 |
+ talloc_free(grp_sysdb_fqname);
|
|
|
b2d430 |
+
|
|
|
b2d430 |
ret = sysdb_mod_group_member(dom, member_dn, parent_dn, optype);
|
|
|
b2d430 |
if (ret) {
|
|
|
b2d430 |
goto done;
|
|
|
b2d430 |
--
|
|
|
b2d430 |
2.7.4
|
|
|
b2d430 |
|