|
|
cd9052 |
From cf40987b7f847be70ef3a5a0fa359116c0259477 Mon Sep 17 00:00:00 2001
|
|
|
cd9052 |
From: Sumit Bose <sbose@redhat.com>
|
|
|
cd9052 |
Date: Fri, 30 Oct 2020 13:19:09 +0100
|
|
|
cd9052 |
Subject: [PATCH 1/6] service: add REALM_DBUS_OPTION_USE_LDAPS and
|
|
|
cd9052 |
realm_get_use_ldaps
|
|
|
cd9052 |
|
|
|
cd9052 |
Add a new option to the realmd service to use ldaps where possible and
|
|
|
cd9052 |
supported.
|
|
|
cd9052 |
|
|
|
cd9052 |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1826964
|
|
|
cd9052 |
---
|
|
|
cd9052 |
dbus/realm-dbus-constants.h | 1 +
|
|
|
cd9052 |
service/realm-options.c | 17 +++++++++++++++++
|
|
|
cd9052 |
service/realm-options.h | 2 ++
|
|
|
cd9052 |
3 files changed, 20 insertions(+)
|
|
|
cd9052 |
|
|
|
cd9052 |
diff --git a/dbus/realm-dbus-constants.h b/dbus/realm-dbus-constants.h
|
|
|
cd9052 |
index 40ffa2d..0bd7a5d 100644
|
|
|
cd9052 |
--- a/dbus/realm-dbus-constants.h
|
|
|
cd9052 |
+++ b/dbus/realm-dbus-constants.h
|
|
|
cd9052 |
@@ -70,6 +70,7 @@ G_BEGIN_DECLS
|
|
|
cd9052 |
#define REALM_DBUS_OPTION_OS_NAME "os-name"
|
|
|
cd9052 |
#define REALM_DBUS_OPTION_OS_VERSION "os-version"
|
|
|
cd9052 |
#define REALM_DBUS_OPTION_LEGACY_SMB_CONF "legacy-samba-config"
|
|
|
cd9052 |
+#define REALM_DBUS_OPTION_USE_LDAPS "use-ldaps"
|
|
|
cd9052 |
|
|
|
cd9052 |
#define REALM_DBUS_IDENTIFIER_ACTIVE_DIRECTORY "active-directory"
|
|
|
cd9052 |
#define REALM_DBUS_IDENTIFIER_WINBIND "winbind"
|
|
|
cd9052 |
diff --git a/service/realm-options.c b/service/realm-options.c
|
|
|
cd9052 |
index 34a209f..d42eb7c 100644
|
|
|
cd9052 |
--- a/service/realm-options.c
|
|
|
cd9052 |
+++ b/service/realm-options.c
|
|
|
cd9052 |
@@ -199,3 +199,20 @@ realm_options_ad_specific (GVariant *options,
|
|
|
cd9052 |
|
|
|
cd9052 |
return g_strdup (value);
|
|
|
cd9052 |
}
|
|
|
cd9052 |
+
|
|
|
cd9052 |
+gboolean realm_option_use_ldaps (GVariant *options)
|
|
|
cd9052 |
+{
|
|
|
cd9052 |
+ gchar *use_ldaps_str;
|
|
|
cd9052 |
+
|
|
|
cd9052 |
+ use_ldaps_str = realm_options_ad_specific (options,
|
|
|
cd9052 |
+ REALM_DBUS_OPTION_USE_LDAPS);
|
|
|
cd9052 |
+ if (use_ldaps_str != NULL
|
|
|
cd9052 |
+ && ( g_ascii_strcasecmp (use_ldaps_str, "True") == 0
|
|
|
cd9052 |
+ || g_ascii_strcasecmp (use_ldaps_str, "Yes") == 0)) {
|
|
|
cd9052 |
+ g_free (use_ldaps_str);
|
|
|
cd9052 |
+ return TRUE;
|
|
|
cd9052 |
+ }
|
|
|
cd9052 |
+ g_free (use_ldaps_str);
|
|
|
cd9052 |
+
|
|
|
cd9052 |
+ return FALSE;
|
|
|
cd9052 |
+}
|
|
|
cd9052 |
diff --git a/service/realm-options.h b/service/realm-options.h
|
|
|
cd9052 |
index b71d219..bc13cd7 100644
|
|
|
cd9052 |
--- a/service/realm-options.h
|
|
|
cd9052 |
+++ b/service/realm-options.h
|
|
|
cd9052 |
@@ -48,6 +48,8 @@ const gchar * realm_options_computer_name (GVariant *options,
|
|
|
cd9052 |
const gchar * realm_options_ad_specific (GVariant *options,
|
|
|
cd9052 |
const gchar *option_name);
|
|
|
cd9052 |
|
|
|
cd9052 |
+gboolean realm_option_use_ldaps (GVariant *options);
|
|
|
cd9052 |
+
|
|
|
cd9052 |
G_END_DECLS
|
|
|
cd9052 |
|
|
|
cd9052 |
#endif /* __REALM_OPTIONS_H__ */
|
|
|
cd9052 |
--
|
|
|
cd9052 |
2.26.2
|
|
|
cd9052 |
|