URL:
https://github.com/SSSD/sssd/pull/650
Title: #650: Implement a hybrid mode of generating private groups
mzidek-rh commented:
"""
It looks like these patches work fine I have just few nitpicks, see the following two
patches that should be squashed into your patches (to second and to third patch) The first
patch just fixes line > 80 chars and the second ads a comment.
Unfortunately the whole patchset needs to be rebased on top of current master due to
recent changes (that is my fault, sorry for the delay :/ )
```
From 04fcd2bab86318117b6186225a7df9c9838ca4c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C5=BDidek?= <mzidek(a)redhat.com>
Date: Tue, 2 Oct 2018 12:03:57 +0200
Subject: [PATCH 3/8] Fixup with: UTIL: Convert bool mpg to an enum mpg_mode
---
src/db/sysdb.h | 3 ++-
src/db/sysdb_subdomains.c | 3 ++-
src/providers/ad/ad_subdomains.c | 3 ++-
src/providers/ipa/ipa_subdomains.c | 3 ++-
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index a1d415d..9ab43c0 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -526,7 +526,8 @@ sysdb_set_site(struct sss_domain_info *dom,
errno_t sysdb_subdomain_store(struct sysdb_ctx *sysdb,
const char *name, const char *realm,
const char *flat_name, const char *domain_id,
- enum sss_domain_mpg_mode mpg_mode, bool enumerate, const
char *forest,
+ enum sss_domain_mpg_mode mpg_mode,
+ bool enumerate, const char *forest,
uint32_t trust_direction,
struct ldb_message_element *upn_suffixes);
diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c
index b0f6540..dced9a9 100644
--- a/src/db/sysdb_subdomains.c
+++ b/src/db/sysdb_subdomains.c
@@ -900,7 +900,8 @@ done:
errno_t sysdb_subdomain_store(struct sysdb_ctx *sysdb,
const char *name, const char *realm,
const char *flat_name, const char *domain_id,
- enum sss_domain_mpg_mode mpg_mode, bool enumerate, const
char *forest,
+ enum sss_domain_mpg_mode mpg_mode,
+ bool enumerate, const char *forest,
uint32_t trust_direction,
struct ldb_message_element *upn_suffixes)
{
diff --git a/src/providers/ad/ad_subdomains.c b/src/providers/ad/ad_subdomains.c
index bbd358f..5b04677 100644
--- a/src/providers/ad/ad_subdomains.c
+++ b/src/providers/ad/ad_subdomains.c
@@ -501,7 +501,8 @@ ad_subdom_store(struct sdap_idmap_ctx *idmap_ctx,
goto done;
}
- use_id_mapping = sdap_idmap_domain_has_algorithmic_mapping(idmap_ctx, name,
sid_str);
+ use_id_mapping = sdap_idmap_domain_has_algorithmic_mapping(idmap_ctx,
+ name, sid_str);
if (use_id_mapping == true) {
mpg_mode = MPG_ENABLED;
} else {
diff --git a/src/providers/ipa/ipa_subdomains.c b/src/providers/ipa/ipa_subdomains.c
index 2d96572..d86ca4c 100644
--- a/src/providers/ipa/ipa_subdomains.c
+++ b/src/providers/ipa/ipa_subdomains.c
@@ -612,7 +612,8 @@ static errno_t ipa_subdom_store(struct sss_domain_info *parent,
goto done;
}
- use_id_mapping = sdap_idmap_domain_has_algorithmic_mapping(sdap_idmap_ctx, name,
id);
+ use_id_mapping = sdap_idmap_domain_has_algorithmic_mapping(sdap_idmap_ctx,
+ name, id);
if (use_id_mapping == true) {
mpg_mode = MPG_ENABLED;
} else {
--
2.9.5
```
```
From e3bc16f7443c4eecd1873f3c5ae8a09db6b8b947 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C5=BDidek?= <mzidek(a)redhat.com>
Date: Tue, 2 Oct 2018 12:53:02 +0200
Subject: [PATCH 5/8] Fixup with: CONFDB: Read auto_private_groups as string,
not bool
---
src/db/sysdb_subdomains.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c
index cb9be3f..6083e08 100644
--- a/src/db/sysdb_subdomains.c
+++ b/src/db/sysdb_subdomains.c
@@ -1003,6 +1003,7 @@ errno_t sysdb_subdomain_store(struct sysdb_ctx *sysdb,
tmp_str = ldb_msg_find_attr_as_string(res->msgs[0],
SYSDB_SUBDOMAIN_MPG,
"false");
+ /* If mpg_mode changed we need to replace the old value in sysdb */
switch (mpg_mode) {
case MPG_ENABLED:
if (strcasecmp(tmp_str, "true") != 0) {
--
2.9.5
```
"""
See the full comment at
https://github.com/SSSD/sssd/pull/650#issuecomment-426248938