[SSSD] [PATCH] Use GID if subdomain is not MPG

Jakub Hrozek jhrozek at redhat.com
Fri Jul 26 09:42:38 UTC 2013


Scott tested the attached patch yesterday during the test day. It
fixes https://fedorahosted.org/sssd/ticket/2032
-------------- next part --------------
>From ce42ab09e4fb9a5fe6ade1c3140999cf241db588 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Thu, 25 Jul 2013 20:44:29 +0200
Subject: [PATCH] Use GID if subdomain is not MPG

https://fedorahosted.org/sssd/ticket/2032

In non-MPG subdomains (such as those that manage their IDs manually with
POSIX attributes), we need to set the GID ourself.
---
 src/providers/ipa/ipa_s2n_exop.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/providers/ipa/ipa_s2n_exop.c b/src/providers/ipa/ipa_s2n_exop.c
index f589a06fe12ff3bb02129b3fa5ad78feddcb7724..e16ec149d614e311d45b6933a29808c4578112e4 100644
--- a/src/providers/ipa/ipa_s2n_exop.c
+++ b/src/providers/ipa/ipa_s2n_exop.c
@@ -654,6 +654,7 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq)
     char *realm;
     char *upn;
     struct berval *bv_req = NULL;
+    gid_t gid;
 
     ret = ipa_s2n_exop_recv(subreq, state, &retoid, &retdata);
     talloc_zfree(subreq);
@@ -815,8 +816,14 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq)
                 }
             }
 
+            gid = 0;
+            if (state->dom->mpg == false) {
+                gid = attrs->a.user.pw_gid;
+            }
+
             ret = sysdb_store_user(state->dom->sysdb, state->dom, name, NULL,
-                                   attrs->a.user.pw_uid, 0, NULL, /* gecos */
+                                   attrs->a.user.pw_uid,
+                                   gid, NULL, /* gecos */
                                    homedir, NULL, NULL, user_attrs, NULL,
                                    timeout, now);
             break;
-- 
1.8.3.1



More information about the sssd-devel mailing list