diff -Nru realmd-0.17.0/debian/changelog realmd-0.17.0/debian/changelog --- realmd-0.17.0/debian/changelog 2022-01-06 17:39:36.000000000 +0000 +++ realmd-0.17.0/debian/changelog 2022-02-22 20:13:51.000000000 +0000 @@ -1,3 +1,10 @@ +realmd (0.17.0-1ubuntu2) jammy; urgency=medium + + * d/p/06_samba_415_update.patch, d/rules: update for net ads join + command from samba 4.15 (LP: #1961443) + + -- Andreas Hasenack Tue, 22 Feb 2022 17:13:51 -0300 + realmd (0.17.0-1ubuntu1) jammy; urgency=medium * Merge with Debian unstable (LP: #1946896). Remaining changes: diff -Nru realmd-0.17.0/debian/patches/06_samba_415_update.patch realmd-0.17.0/debian/patches/06_samba_415_update.patch --- realmd-0.17.0/debian/patches/06_samba_415_update.patch 1970-01-01 00:00:00.000000000 +0000 +++ realmd-0.17.0/debian/patches/06_samba_415_update.patch 2022-02-22 20:13:51.000000000 +0000 @@ -0,0 +1,132 @@ +From 68f73b78a34299ee37dd06e2ab3ede8985fa277b Mon Sep 17 00:00:00 2001 +From: Sumit Bose +Date: Tue, 14 Dec 2021 15:32:32 +0100 +Subject: samba: use new Samba-4.15 command line options + +Samba-4.15 changed a couple of command line options of the net utility. +This patch adds a configure option to select the new or the old style. +If the option is not used configure tries to call the net utility to +check for the options. If this fails the old style is used. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2028530 +--- + configure.ac | 34 ++++++++++++++++++++++++++++++++++ + service/realm-samba-enroll.c | 18 +++++++++++++----- + 2 files changed, 47 insertions(+), 5 deletions(-) + +Bug-Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=2028530 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/realmd/+bug/1961443 +Origin: upstream, https://cgit.freedesktop.org/realmd/realmd/commit/?id=68f73b78a34299ee37dd06e2ab3ede8985fa277b +Last-Update: 2022-02-22 +diff --git a/configure.ac b/configure.ac +index ea51f92..ddc25d0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -227,6 +227,40 @@ LDAP_CFLAGS="" + AC_SUBST(LDAP_LIBS) + AC_SUBST(LDAP_CFLAGS) + ++# ------------------------------------------------------------------- ++# Samba ++ ++AC_ARG_WITH(new-samba-cli-options, ++ AS_HELP_STRING([--with-new-samba-cli-options=yes/no], ++ [Use new command line options introduced with Samba-4.15, ++ if not provided the output of 'net help' is checked or old ++ style options are used])) ++ ++if test "$with_new_samba_cli_options" = "no"; then ++ AC_MSG_RESULT([Using old Samba command line options]) ++elif test "$with_new_samba_cli_options" = "yes"; then ++ AC_DEFINE_UNQUOTED(WITH_NEW_SAMBA_CLI_OPTS, 1, ++ [Use new command line options introduced with Samba-4.15]) ++ AC_MSG_RESULT([Using new Samba command line options]) ++else ++ AC_PATH_PROG([SAMBA_NET], [net]) ++ if test ! -x "$SAMBA_NET"; then ++ AC_MSG_NOTICE([Could not find Samba's net utility, ] ++ [assuming old style command line options, ] ++ [please install the net utility for proper detection.]) ++ else ++ AC_MSG_CHECKING([for --debug-stdout option of net]) ++ if AC_RUN_LOG([$SAMBA_NET help 2>&1 |grep -- '--debug-stdout' > /dev/null]); then ++ AC_DEFINE_UNQUOTED(WITH_NEW_SAMBA_CLI_OPTS, 1, ++ [Use new command line options introduced with Samba-4.15]) ++ AC_MSG_RESULT([yes]) ++ else ++ AC_MSG_RESULT([no]) ++ fi ++ fi ++fi ++ ++ + # ------------------------------------------------------------------- + # Directories + +diff --git a/service/realm-samba-enroll.c b/service/realm-samba-enroll.c +index 5624a08..8b2ee38 100644 +--- a/service/realm-samba-enroll.c ++++ b/service/realm-samba-enroll.c +@@ -37,6 +37,14 @@ + #include + #include + ++#ifdef WITH_NEW_SAMBA_CLI_OPTS ++#define SMBCLI_KERBEROS "--use-kerberos=required" ++#define SMBCLI_CONF "--configfile" ++#else ++#define SMBCLI_KERBEROS "-k" ++#define SMBCLI_CONF "-s" ++#endif ++ + typedef struct { + GDBusMethodInvocation *invocation; + gchar *join_args[8]; +@@ -260,7 +268,7 @@ begin_net_process (JoinClosure *join, + /* Use our custom smb.conf */ + g_ptr_array_add (args, (gpointer)realm_settings_path ("net")); + if (join->custom_smb_conf) { +- g_ptr_array_add (args, "-s"); ++ g_ptr_array_add (args, SMBCLI_CONF); + g_ptr_array_add (args, join->custom_smb_conf); + } + +@@ -370,7 +378,7 @@ on_join_do_keytab (GObject *source, + } else { + begin_net_process (join, NULL, + on_keytab_do_finish, g_object_ref (task), +- "-k", "ads", "keytab", "create", NULL); ++ SMBCLI_KERBEROS, "ads", "keytab", "create", NULL); + } + + g_object_unref (task); +@@ -428,7 +436,7 @@ begin_join (GTask *task, + begin_net_process (join, join->password_input, + on_join_do_keytab, g_object_ref (task), + "-U", join->user_name, +- "-k", "ads", "join", join->disco->domain_name, ++ SMBCLI_KERBEROS, "ads", "join", join->disco->domain_name, + join->join_args[0], join->join_args[1], + join->join_args[2], join->join_args[3], + join->join_args[4], NULL); +@@ -437,7 +445,7 @@ begin_join (GTask *task, + } else { + begin_net_process (join, NULL, + on_join_do_keytab, g_object_ref (task), +- "-k", "ads", "join", join->disco->domain_name, ++ SMBCLI_KERBEROS, "ads", "join", join->disco->domain_name, + join->join_args[0], join->join_args[1], + join->join_args[2], join->join_args[3], + join->join_args[4], NULL); +@@ -543,7 +551,7 @@ realm_samba_enroll_leave_async (RealmDisco *disco, + join->envvar = g_strdup_printf ("KRB5CCNAME=%s", cred->x.ccache.file); + begin_net_process (join, NULL, + on_leave_complete, g_object_ref (task), +- "-k", "ads", "leave", NULL); ++ SMBCLI_KERBEROS, "ads", "leave", NULL); + break; + default: + g_return_if_reached (); +-- +cgit v1.2.1 + diff -Nru realmd-0.17.0/debian/patches/series realmd-0.17.0/debian/patches/series --- realmd-0.17.0/debian/patches/series 2022-01-06 17:39:36.000000000 +0000 +++ realmd-0.17.0/debian/patches/series 2022-02-22 20:13:43.000000000 +0000 @@ -3,3 +3,4 @@ 03_ldap-discovery-socket-timeout.patch 04_add-computer-name-to-manpage.patch 05_dont-add-services-line.patch +06_samba_415_update.patch diff -Nru realmd-0.17.0/debian/rules realmd-0.17.0/debian/rules --- realmd-0.17.0/debian/rules 2022-01-05 20:08:43.000000000 +0000 +++ realmd-0.17.0/debian/rules 2022-02-22 20:13:51.000000000 +0000 @@ -18,6 +18,7 @@ override_dh_auto_configure: dh_auto_configure -- --libdir=/usr/lib \ --htmldir=/usr/share/doc/realmd/html \ + --with-new-samba-cli-options=yes \ --with-distro=debian ${SYSTEMD_PARAMS} override_dh_installchangelogs: