diff options
author | Brad Ackerman | 2021-03-19 19:59:42 -0700 |
---|---|---|
committer | Brad Ackerman | 2021-03-19 19:59:42 -0700 |
commit | 37ed55fef37e2b63992624ac6b38abb085b4b3b8 (patch) | |
tree | ad686f9fc0f51447b4e2818abf8d57c243353d6c /0003-discover-try-to-get-domain-name-from-hostname.patch | |
parent | f440bcd34523ad4b2f8a1cd7d3d70c6eb14f9b6c (diff) | |
download | aur-37ed55fef37e2b63992624ac6b38abb085b4b3b8.tar.gz |
Bump version to 0.17.0.
Diffstat (limited to '0003-discover-try-to-get-domain-name-from-hostname.patch')
-rw-r--r-- | 0003-discover-try-to-get-domain-name-from-hostname.patch | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/0003-discover-try-to-get-domain-name-from-hostname.patch b/0003-discover-try-to-get-domain-name-from-hostname.patch deleted file mode 100644 index b611d6c8ada8..000000000000 --- a/0003-discover-try-to-get-domain-name-from-hostname.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 5e28cf702ad338e399f8fff0b3fa18736a297318 Mon Sep 17 00:00:00 2001 -From: Sumit Bose <sbose@redhat.com> -Date: Tue, 21 Aug 2018 13:09:20 +0200 -Subject: [PATCH 3/3] discover: try to get domain name from hostname - -If there is no domain name returned by DHCP check if the hostname -contains a domain part and use this to discover a realm. - -Related to https://bugzilla.redhat.com/show_bug.cgi?id=1619162 ---- - service/realm-provider.c | 28 +++++++++++++++++++++++++++- - 1 file changed, 27 insertions(+), 1 deletion(-) - -diff --git a/service/realm-provider.c b/service/realm-provider.c -index d647c7a..258e8e1 100644 ---- a/service/realm-provider.c -+++ b/service/realm-provider.c -@@ -28,6 +28,8 @@ - #include <glib/gi18n.h> - #include <gio/gio.h> - -+#include <errno.h> -+ - #define TIMEOUT_SECONDS 15 - - G_DEFINE_TYPE (RealmProvider, realm_provider, G_TYPE_DBUS_OBJECT_SKELETON); -@@ -181,6 +183,25 @@ on_discover_complete (GObject *source, - return_discover_result (method, realms, relevance, error); - } - -+static gchar * -+get_domain_from_hostname (void) -+{ -+ gchar hostname[HOST_NAME_MAX + 1]; -+ gchar *dot; -+ -+ if (gethostname (hostname, sizeof (hostname)) < 0) { -+ g_warning ("Couldn't get the computer host name: %s", g_strerror (errno)); -+ return NULL; -+ } -+ -+ dot = strchr (hostname, '.'); -+ if (dot != NULL) { -+ return g_strdup (dot + 1); -+ } -+ -+ return NULL; -+} -+ - static void - on_discover_default (GObject *source, - GAsyncResult *result, -@@ -195,6 +216,10 @@ on_discover_default (GObject *source, - g_clear_error (&error); - } - -+ if (method->string == NULL) { -+ method->string = get_domain_from_hostname (); -+ } -+ - if (method->string) { - g_strstrip (method->string); - if (g_str_equal (method->string, "")) { -@@ -210,7 +235,8 @@ on_discover_default (GObject *source, - on_discover_complete, method); - - } else { -- realm_diagnostics_info (method->invocation, "No default domain received via DHCP"); -+ realm_diagnostics_info (method->invocation, -+ "No default domain received via DHCP or given by hostname"); - return_discover_result (method, NULL, 0, NULL); - } - } --- -2.17.1 - |