diff --git a/0001-build-add-with-vendor-error-message-configure-option.patch b/0001-build-add-with-vendor-error-message-configure-option.patch new file mode 100644 index 0000000..faac53c --- /dev/null +++ b/0001-build-add-with-vendor-error-message-configure-option.patch @@ -0,0 +1,61 @@ +From 4ef597d15df246f4121266aaf3e291e3f06f6f4a Mon Sep 17 00:00:00 2001 +From: Sumit Bose +Date: Wed, 10 Mar 2021 17:57:07 +0100 +Subject: [PATCH 1/2] build: add --with-vendor-error-message configure option + +With the new configure option --with-vendor-error-message a packager or +a distribution can add a message if realmd returns with an error. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1889386 +--- + configure.ac | 15 +++++++++++++++ + tools/realm.c | 7 +++++++ + 2 files changed, 22 insertions(+) + +diff --git a/configure.ac b/configure.ac +index ee067d9..05ec1bf 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -51,6 +51,21 @@ fi + + AC_SUBST(DISTRO) + ++# ----------------------------------------------------------------------------- ++# Vendor error message ++ ++AC_ARG_WITH([vendor-error-message], ++ [AS_HELP_STRING([--with-vendor-error-message=ARG], ++ [Add a vendor specific error message shown if a realm command fails] ++ )], ++ [AS_IF([test "x$withval" != "x"], ++ [AC_DEFINE_UNQUOTED([VENDOR_MSG], ++ ["$withval"], ++ [Vendor specific error message])], ++ [AC_MSG_ERROR([--with-vendor-error-message requires an argument])] ++ )], ++ []) ++ + # ----------------------------------------------------------------------------- + # Basic tools + +diff --git a/tools/realm.c b/tools/realm.c +index 1530f09..8fdca16 100644 +--- a/tools/realm.c ++++ b/tools/realm.c +@@ -287,6 +287,13 @@ main (int argc, + ret = (realm_commands[i].function) (client, argc, argv); + g_object_unref (client); + ++#ifdef VENDOR_MSG ++ if (ret != 0) { ++ g_printerr (VENDOR_MSG"\n"); ++ } ++ ++#endif ++ + break; + } + } +-- +2.30.2 + diff --git a/0001-doc-add-computer-name-to-realm-man-page.patch b/0001-doc-add-computer-name-to-realm-man-page.patch new file mode 100644 index 0000000..f5345d6 --- /dev/null +++ b/0001-doc-add-computer-name-to-realm-man-page.patch @@ -0,0 +1,36 @@ +From 05100771ea6bd775caae705bb53f76a0816f3b81 Mon Sep 17 00:00:00 2001 +From: Sumit Bose +Date: Tue, 11 May 2021 11:13:06 +0200 +Subject: [PATCH] doc: add computer-name to realm man page + +--- + doc/manual/realm.xml | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/doc/manual/realm.xml b/doc/manual/realm.xml +index 9160a8a..b4dc27c 100644 +--- a/doc/manual/realm.xml ++++ b/doc/manual/realm.xml +@@ -222,6 +222,19 @@ $ realm join --user=admin --computer-ou=OU=Special domain.example.com + supported for all realms. By default the membership software + is automatically selected. + ++ ++ ++ ++ This option only applies to Active ++ Directory realms. Specify this option to ++ override the default name used when creating ++ the computer account. The system's FQDN will ++ still be saved in the dNSHostName attribute. ++ Specify the name as a string of 15 or ++ fewer characters that is a valid NetBIOS ++ computer name. ++ ++ + + + Perform the join automatically without +-- +2.31.1 + diff --git a/0002-configure-update-some-macros-for-autoconf-2.71.patch b/0002-configure-update-some-macros-for-autoconf-2.71.patch new file mode 100644 index 0000000..a47f0c5 --- /dev/null +++ b/0002-configure-update-some-macros-for-autoconf-2.71.patch @@ -0,0 +1,77 @@ +From cff19e9044e3f389a14fbc5e98366a31107d4a02 Mon Sep 17 00:00:00 2001 +From: Sumit Bose +Date: Tue, 6 Apr 2021 15:23:54 +0200 +Subject: [PATCH 2/2] configure: update some macros for autoconf-2.71 + +--- + configure.ac | 15 +++++++-------- + 1 file changed, 7 insertions(+), 8 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 05ec1bf..4dac5a9 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1,4 +1,4 @@ +-AC_PREREQ(2.63) ++AC_PREREQ([2.63]) + + AC_INIT([realmd], [0.17.0], + [https://gitlab.freedesktop.org/realmd/realmd/-/issues], +@@ -69,8 +69,7 @@ AC_ARG_WITH([vendor-error-message], + # ----------------------------------------------------------------------------- + # Basic tools + +-AC_GNU_SOURCE +-AC_ISC_POSIX ++AC_USE_SYSTEM_EXTENSIONS + AC_PROG_CC + AC_PROG_CPP + AM_PROG_CC_C_O +@@ -109,7 +108,7 @@ AC_SUBST(POLKIT_LIBS) + + AC_MSG_CHECKING([systemd unit directory]) + AC_ARG_WITH(systemd-unit-dir, +- AC_HELP_STRING([--with-systemd-unit-dir], ++ AS_HELP_STRING([--with-systemd-unit-dir], + [Directory to install systemd service file])) + + if test "$with_systemd_unit_dir" = "" -o "$with_systemd_unit_dir" = "yes"; then +@@ -136,7 +135,7 @@ AC_SUBST(dbus_systemd_service) + AC_MSG_RESULT($with_systemd_unit_dir) + + AC_ARG_WITH(systemd-journal, +- AC_HELP_STRING([--with-systemd-journal], ++ AS_HELP_STRING([--with-systemd-journal], + [Use systemd's journal for logging])) + + if test "$with_systemd_journal" != "no"; then +@@ -245,7 +244,7 @@ AC_SUBST(POLKIT_ACTION_DIR) + + AC_MSG_CHECKING([whether to build documentation]) + AC_ARG_ENABLE(doc, +- AC_HELP_STRING([--enable-doc], ++ AS_HELP_STRING([--enable-doc], + [Disable building documentation]) + ) + +@@ -314,7 +313,7 @@ AC_SUBST(GENHTML) + + AC_MSG_CHECKING([for debug mode]) + AC_ARG_ENABLE(debug, +- AC_HELP_STRING([--enable-debug=no/default/yes], ++ AS_HELP_STRING([--enable-debug=no/default/yes], + [Turn on or off debugging]) + ) + +@@ -397,7 +396,7 @@ AC_SUBST(TEST_MODE) + privatedir='${prefix}/lib/realmd' + AC_MSG_CHECKING([private directory]) + AC_ARG_WITH(private-dir, +- AC_HELP_STRING([--with-private-dir=DIR], ++ AS_HELP_STRING([--with-private-dir=DIR], + [Directory to install realmd system defaults (default: ${prefix}/lib/realmd)])) + + if test -n "$with_private_dir"; then +-- +2.30.2 + diff --git a/realmd.spec b/realmd.spec index 7c2f8ed..18b85c0 100644 --- a/realmd.spec +++ b/realmd.spec @@ -1,12 +1,15 @@ Name: realmd Version: 0.17.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Kerberos realm enrollment service License: LGPLv2+ URL: https://gitlab.freedesktop.org/realmd/realmd Source0: https://gitlab.freedesktop.org/sbose/realmd/uploads/b13a87292762bdad3ecbfe65bbb57211/realmd-%{version}.tar.gz Patch1: 0001-switch-to-authselect.patch +Patch2: 0001-build-add-with-vendor-error-message-configure-option.patch +Patch3: 0002-configure-update-some-macros-for-autoconf-2.71.patch +Patch4: 0001-doc-add-computer-name-to-realm-man-page.patch BuildRequires: make BuildRequires: gcc @@ -47,7 +50,12 @@ applications that use %{name}. %build autoreconf -fi -%configure --disable-silent-rules +%configure --disable-silent-rules \ +%if 0%{?rhel} + --with-vendor-error-message='Please check\n https://red.ht/support_rhel_ad \nto get help for common issues.' \ +%endif + %{nil} + make %{?_smp_mflags} %check @@ -58,6 +66,15 @@ make install DESTDIR=%{buildroot} %find_lang realmd +%post +%systemd_post realmd.service + +%preun +%systemd_preun realmd.service + +%postun +%systemd_postun_with_restart realmd.service + %files -f realmd.lang %doc AUTHORS COPYING NEWS README %{_sysconfdir}/dbus-1/system.d/org.freedesktop.realmd.conf @@ -78,6 +95,10 @@ make install DESTDIR=%{buildroot} %doc ChangeLog %changelog +* Tue Jun 29 2021 Sumit Bose - 0.17.0-5 +- Updates and fixes from upstream, Fedora and RHEL-8.5 + Resolves: rhbz#1977163 + * Fri Apr 16 2021 Mohan Boddu - 0.17.0-4 - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937