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/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/gating.yaml b/gating.yaml new file mode 100644 index 0000000..c190bde --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} diff --git a/realmd.spec b/realmd.spec index 43493b2..be416dd 100644 --- a/realmd.spec +++ b/realmd.spec @@ -1,12 +1,14 @@ Name: realmd Version: 0.17.0 -Release: 3%{?dist} +Release: 4%{?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 BuildRequires: make BuildRequires: gcc @@ -78,6 +80,10 @@ make install DESTDIR=%{buildroot} %doc ChangeLog %changelog +* Tue Apr 06 2021 Sumit Bose - 0.17.0-4 +- Add vendor error message, autoconf-2.71 fixes, downstream gating + Resolves: rhbz#1889386 + * Wed Mar 03 2021 Sumit Bose - 0.17.0-3 - Use authselect instead of authconfig Resolves: rhbz#1934124