dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0129-TOOLS-sss_groupshow-did-not-work.patch

b2d430
From 7d8269e8a885cc0344dc78951d2880edac32a02c Mon Sep 17 00:00:00 2001
b2d430
From: =?UTF-8?q?Michal=20=C5=BDidek?= <mzidek@redhat.com>
b2d430
Date: Tue, 6 Sep 2016 13:46:53 +0200
b2d430
Subject: [PATCH 129/135] TOOLS: sss_groupshow did not work
b2d430
MIME-Version: 1.0
b2d430
Content-Type: text/plain; charset=UTF-8
b2d430
Content-Transfer-Encoding: 8bit
b2d430
b2d430
sss_groupshow used shortname to search
b2d430
in sysdb database. We have to u e sysdb_fqname
b2d430
(aka internal_fqname) format for all sysdb
b2d430
oprations.
b2d430
b2d430
Resolves:
b2d430
https://fedorahosted.org/sssd/ticket/3175
b2d430
b2d430
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
b2d430
(cherry picked from commit 5210c5d3a5a83b5d08396ee23d88f6ba0994097d)
b2d430
---
b2d430
 src/tools/sss_groupshow.c | 13 +++++++++++--
b2d430
 1 file changed, 11 insertions(+), 2 deletions(-)
b2d430
b2d430
diff --git a/src/tools/sss_groupshow.c b/src/tools/sss_groupshow.c
b2d430
index 41d7475cef1093a4cb214ec4b017db59e6c26fe2..5870cc802c70366c47a0d30cb0d9795cf6035bc5 100644
b2d430
--- a/src/tools/sss_groupshow.c
b2d430
+++ b/src/tools/sss_groupshow.c
b2d430
@@ -318,7 +318,7 @@ int group_show(TALLOC_CTX *mem_ctx,
b2d430
                struct sysdb_ctx *sysdb,
b2d430
                struct sss_domain_info *domain,
b2d430
                bool   recursive,
b2d430
-               const char *name,
b2d430
+               const char *shortname,
b2d430
                struct group_info **res)
b2d430
 {
b2d430
     struct group_info *root;
b2d430
@@ -326,11 +326,20 @@ int group_show(TALLOC_CTX *mem_ctx,
b2d430
     struct ldb_message *msg = NULL;
b2d430
     const char **group_members = NULL;
b2d430
     int nmembers = 0;
b2d430
+    char *sysdb_fqname = NULL;
b2d430
     int ret;
b2d430
     int i;
b2d430
 
b2d430
+    sysdb_fqname = sss_create_internal_fqname(mem_ctx,
b2d430
+                                              shortname,
b2d430
+                                              domain->name);
b2d430
+    if (sysdb_fqname == NULL) {
b2d430
+        return ENOMEM;
b2d430
+    }
b2d430
+
b2d430
     /* First, search for the root group */
b2d430
-    ret = sysdb_search_group_by_name(mem_ctx, domain, name, attrs, &msg;;
b2d430
+    ret = sysdb_search_group_by_name(mem_ctx, domain, sysdb_fqname, attrs,
b2d430
+                                     &msg;;
b2d430
     if (ret) {
b2d430
         DEBUG(SSSDBG_OP_FAILURE,
b2d430
               "Search failed: %s (%d)\n", strerror(ret), ret);
b2d430
-- 
b2d430
2.7.4
b2d430