Blame SOURCES/0001-Change-qualified-names-default-for-IPA.patch

4d12ff
From 21ab1fdd127d242a9b4e95c3c90dd2bf3159d149 Mon Sep 17 00:00:00 2001
4d12ff
From: Sumit Bose <sbose@redhat.com>
4d12ff
Date: Tue, 14 Aug 2018 16:44:39 +0200
4d12ff
Subject: [PATCH] Change qualified names default for IPA
4d12ff
4d12ff
In a FreeIPA domain it is typically expected that the IPA accounts use
4d12ff
sort names while accounts from trusted domains have fully qualified
4d12ff
names. This is automatically done by SSSD's IPA provider so there is no
4d12ff
need to force fully qualified names in the SSSD configuration.
4d12ff
4d12ff
Related to https://bugzilla.redhat.com/show_bug.cgi?id=1619162
4d12ff
---
4d12ff
 service/realm-options.c       | 9 +++++----
4d12ff
 service/realm-options.h       | 3 ++-
4d12ff
 service/realm-samba-winbind.c | 2 +-
4d12ff
 service/realm-sssd-ad.c       | 2 +-
4d12ff
 service/realm-sssd-ipa.c      | 2 +-
4d12ff
 5 files changed, 10 insertions(+), 8 deletions(-)
4d12ff
4d12ff
diff --git a/service/realm-options.c b/service/realm-options.c
4d12ff
index bd804ea..34a209f 100644
4d12ff
--- a/service/realm-options.c
4d12ff
+++ b/service/realm-options.c
4d12ff
@@ -98,7 +98,7 @@ realm_options_automatic_mapping (GVariant *options,
4d12ff
 
4d12ff
 	if (realm_name && !option) {
4d12ff
 		section = g_utf8_casefold (realm_name, -1);
4d12ff
-		mapping = realm_settings_boolean (realm_name, REALM_DBUS_OPTION_AUTOMATIC_ID_MAPPING, TRUE);
4d12ff
+		mapping = realm_settings_boolean (section, REALM_DBUS_OPTION_AUTOMATIC_ID_MAPPING, TRUE);
4d12ff
 		g_free (section);
4d12ff
 	}
4d12ff
 
4d12ff
@@ -112,20 +112,21 @@ realm_options_automatic_join (const gchar *realm_name)
4d12ff
 	gboolean mapping;
4d12ff
 
4d12ff
 	section = g_utf8_casefold (realm_name, -1);
4d12ff
-	mapping = realm_settings_boolean (realm_name, "automatic-join", FALSE);
4d12ff
+	mapping = realm_settings_boolean (section, "automatic-join", FALSE);
4d12ff
 	g_free (section);
4d12ff
 
4d12ff
 	return mapping;
4d12ff
 }
4d12ff
 
4d12ff
 gboolean
4d12ff
-realm_options_qualify_names (const gchar *realm_name)
4d12ff
+realm_options_qualify_names (const gchar *realm_name,
4d12ff
+                             gboolean def)
4d12ff
 {
4d12ff
 	gchar *section;
4d12ff
 	gboolean qualify;
4d12ff
 
4d12ff
 	section = g_utf8_casefold (realm_name, -1);
4d12ff
-	qualify = realm_settings_boolean (realm_name, "fully-qualified-names", TRUE);
4d12ff
+	qualify = realm_settings_boolean (section, "fully-qualified-names", def);
4d12ff
 	g_free (section);
4d12ff
 
4d12ff
 	return qualify;
4d12ff
diff --git a/service/realm-options.h b/service/realm-options.h
4d12ff
index 7a1355e..b71d219 100644
4d12ff
--- a/service/realm-options.h
4d12ff
+++ b/service/realm-options.h
4d12ff
@@ -37,7 +37,8 @@ const gchar *  realm_options_user_principal           (GVariant *options,
4d12ff
 gboolean       realm_options_automatic_mapping        (GVariant *options,
4d12ff
 						       const gchar *realm_name);
4d12ff
 
4d12ff
-gboolean       realm_options_qualify_names            (const gchar *realm_name);
4d12ff
+gboolean       realm_options_qualify_names            (const gchar *realm_name,
4d12ff
+                                                       gboolean def);
4d12ff
 
4d12ff
 gboolean       realm_options_check_domain_name        (const gchar *domain_name);
4d12ff
 
4d12ff
diff --git a/service/realm-samba-winbind.c b/service/realm-samba-winbind.c
4d12ff
index 9335e26..61988eb 100644
4d12ff
--- a/service/realm-samba-winbind.c
4d12ff
+++ b/service/realm-samba-winbind.c
4d12ff
@@ -102,7 +102,7 @@ realm_samba_winbind_configure_async (RealmIniConfig *config,
4d12ff
 		                      "winbind enum groups", "no",
4d12ff
 		                      "winbind offline logon", "yes",
4d12ff
 		                      "winbind refresh tickets", "yes",
4d12ff
-		                      "winbind use default domain", realm_options_qualify_names (domain_name )? "no" : "yes",
4d12ff
+		                      "winbind use default domain", realm_options_qualify_names (domain_name, TRUE )? "no" : "yes",
4d12ff
 		                      "template shell", realm_settings_string ("users", "default-shell"),
4d12ff
 		                      NULL);
4d12ff
 
4d12ff
diff --git a/service/realm-sssd-ad.c b/service/realm-sssd-ad.c
4d12ff
index 8543ca8..de7ce30 100644
4d12ff
--- a/service/realm-sssd-ad.c
4d12ff
+++ b/service/realm-sssd-ad.c
4d12ff
@@ -172,7 +172,7 @@ configure_sssd_for_domain (RealmIniConfig *config,
4d12ff
 	gchar *home;
4d12ff
 
4d12ff
 	home = realm_sssd_build_default_home (realm_settings_string ("users", "default-home"));
4d12ff
-	qualify = realm_options_qualify_names (disco->domain_name);
4d12ff
+	qualify = realm_options_qualify_names (disco->domain_name, TRUE);
4d12ff
 	shell = realm_settings_string ("users", "default-shell");
4d12ff
 	explicit_computer_name = realm_options_computer_name (options, disco->domain_name);
4d12ff
 	realmd_tags = g_string_new ("");
4d12ff
diff --git a/service/realm-sssd-ipa.c b/service/realm-sssd-ipa.c
4d12ff
index ff1dc8a..5029f6b 100644
4d12ff
--- a/service/realm-sssd-ipa.c
4d12ff
+++ b/service/realm-sssd-ipa.c
4d12ff
@@ -201,7 +201,7 @@ on_ipa_client_do_restart (GObject *source,
4d12ff
 
4d12ff
 		realm_sssd_config_update_domain (config, domain, &error,
4d12ff
 		                                 "cache_credentials", "True",
4d12ff
-		                                 "use_fully_qualified_names", realm_options_qualify_names (domain) ? "True" : "False",
4d12ff
+		                                 "use_fully_qualified_names", realm_options_qualify_names (domain, FALSE) ? "True" : "False",
4d12ff
 		                                 "krb5_store_password_if_offline", "True",
4d12ff
 		                                 "default_shell", shell,
4d12ff
 		                                 "fallback_homedir", home,
4d12ff
-- 
4d12ff
2.17.1
4d12ff