From 327d31ee6d255c7313c5c1c763c2cbb89db0d400cedaa5d1532b40a727432a67 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Fri, 10 Jan 2025 13:11:53 +0000 Subject: [PATCH] - Remove unnecessary build dependency libpackagekit-glib2-devel OBS-URL: https://build.opensuse.org/package/show/network/realmd?expand=0&rev=22 --- .gitattributes | 23 ++++ .gitignore | 1 + ...irectory-for-sssd.conf-if-not-exists.patch | 42 ++++++ 0002-Update-OpenSUSE-configuration.patch | 38 ++++++ realmd-0.17.1.tar.bz2 | 3 + realmd.changes | 129 ++++++++++++++++++ realmd.spec | 109 +++++++++++++++ 7 files changed, 345 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 0001-Create-parent-directory-for-sssd.conf-if-not-exists.patch create mode 100644 0002-Update-OpenSUSE-configuration.patch create mode 100644 realmd-0.17.1.tar.bz2 create mode 100644 realmd.changes create mode 100644 realmd.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0001-Create-parent-directory-for-sssd.conf-if-not-exists.patch b/0001-Create-parent-directory-for-sssd.conf-if-not-exists.patch new file mode 100644 index 0000000..014d17d --- /dev/null +++ b/0001-Create-parent-directory-for-sssd.conf-if-not-exists.patch @@ -0,0 +1,42 @@ +From e7e123db1cecceeebafc442ef5ea2e8a282c78d5 Mon Sep 17 00:00:00 2001 +From: Samuel Cabrero +Date: Thu, 7 Nov 2024 13:23:28 +0100 +Subject: [PATCH 1/2] Create parent directory for sssd.conf if not exists + +OpenSUSE ships the default sssd configuration in /usr/etc and +realmd expects /etc/sssd to exists. + +Signed-off-by: Samuel Cabrero +--- + service/realm-ini-config.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/service/realm-ini-config.c b/service/realm-ini-config.c +index 7bbea34..b7a18e3 100644 +--- a/service/realm-ini-config.c ++++ b/service/realm-ini-config.c +@@ -691,6 +691,21 @@ realm_ini_config_write_file (RealmIniConfig *self, + * write an empty file. + */ + if (length > 0 || g_file_test (filename, G_FILE_TEST_EXISTS)) { ++ gchar *dirname; ++ gint rc; ++ ++ dirname = g_path_get_dirname (filename); ++ if (dirname == NULL) { ++ g_bytes_unref (bytes); ++ return FALSE; ++ } ++ ++ rc = g_mkdir_with_parents (dirname, S_IRWXU | S_IRGRP | S_IXGRP); ++ g_free (dirname); ++ if (rc != 0) { ++ g_bytes_unref (bytes); ++ return FALSE; ++ } + + if (self->flags & REALM_INI_PRIVATE) + mask = umask (S_IRWXG | S_IRWXO); +-- +2.47.1 + diff --git a/0002-Update-OpenSUSE-configuration.patch b/0002-Update-OpenSUSE-configuration.patch new file mode 100644 index 0000000..fa3bb82 --- /dev/null +++ b/0002-Update-OpenSUSE-configuration.patch @@ -0,0 +1,38 @@ +From 51bcd3a51d9f591439e775ec1baafd36cc7ae585 Mon Sep 17 00:00:00 2001 +From: Samuel Cabrero +Date: Thu, 7 Nov 2024 13:24:05 +0100 +Subject: [PATCH 2/2] Update OpenSUSE configuration + +* Require sssd-ad package +* If /etc/nsswitch.conf does not exists copy it from /usr/etc + before modifying + +Signed-off-by: Samuel Cabrero +--- + service/realmd-suse.conf | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/service/realmd-suse.conf b/service/realmd-suse.conf +index 68da049..306902a 100644 +--- a/service/realmd-suse.conf ++++ b/service/realmd-suse.conf +@@ -11,6 +11,7 @@ samba-winbind = /usr/sbin/winbindd + + [sssd-packages] + sssd = /usr/sbin/sssd ++sssd-ad = /usr/libexec/sssd/sssd_pac + sssd-tools = /usr/sbin/sss_cache + + [adcli-packages] +@@ -30,7 +31,7 @@ winbind-stop-service = /usr/bin/systemctl stop winbind.service + + + # add pam via pam-config and nssswitch.conf via sed, since there is no cli handling nsswitch (sed add idempotently word sss to nsswitch.conf) +-sssd-enable-logins = /bin/sh -c "/usr/sbin/pam-config --add --sss --mkhomedir && sed -E 's/(passwd:.*) sss/\1/; s/(passwd:.*)/\1 sss/; s/(group:.*) sss/\1/; s/(group:.*)/\1 sss/; s/(shadow:.*) sss/\1/; s/(shadow:.*)/\1 sss/;' -i /etc/nsswitch.conf" ++sssd-enable-logins = /bin/sh -c "/usr/sbin/pam-config --add --sss --mkhomedir && if [ ! -f /etc/nsswitch.conf ]; then cp /usr/etc/nsswitch.conf /etc/nsswitch.conf; fi && sed -E 's/(passwd:.*) sss/\1/; s/(passwd:.*)/\1 sss/; s/(group:.*) sss/\1/; s/(group:.*)/\1 sss/; s/(shadow:.*) sss/\1/; s/(shadow:.*)/\1 sss/;' -i /etc/nsswitch.conf" + # remove pam via pam-config and nssswitch.conf via sed, since there is no cli handling nsswitch (sed remove sss word from passwd/group/shadow lines) + sssd-disable-logins = /usr/bin/sh -c "/usr/sbin/pam-config --delete --sss && sed -E 's/(passwd:.*) sss/\1/; s/(group:.*) sss/\1/; s/(shadow:.*) sss/\1/;' -i /etc/nsswitch.conf" + sssd-enable-service = /usr/bin/systemctl enable sssd.service +-- +2.47.1 + diff --git a/realmd-0.17.1.tar.bz2 b/realmd-0.17.1.tar.bz2 new file mode 100644 index 0000000..13ac629 --- /dev/null +++ b/realmd-0.17.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b514bdb6fe93a72fbc7fd796665d7476615d8ba0c7b61436771951316c333e6a +size 315250 diff --git a/realmd.changes b/realmd.changes new file mode 100644 index 0000000..9ec8c98 --- /dev/null +++ b/realmd.changes @@ -0,0 +1,129 @@ +------------------------------------------------------------------- +Fri Jan 10 10:35:42 UTC 2025 - Samuel Cabrero + +- Remove unnecessary build dependency libpackagekit-glib2-devel + +------------------------------------------------------------------- +Thu Nov 7 12:29:32 UTC 2024 - Samuel Cabrero + +- UsrEtc fixes, create parent directory for sssd.conf; (bsc#1232921); + Add 0001-Create-parent-directory-for-sssd.conf-if-not-exists.patch +- Require sssd-ad and copy nsswitch.conf from /usr/etc prior + modification; (bsc#1232931); Add + 0002-Update-OpenSUSE-configuration.patch + +------------------------------------------------------------------- +Fri Apr 14 21:36:23 UTC 2023 - FroggyFlox + +- Adjust BuildRequires to enable detection of samba-cli version + during configure: + + samba-client + +------------------------------------------------------------------- +Sat Jan 28 15:12:39 UTC 2023 - Dirk Müller + +- update to 0.17.1: + * Kerberos: use fewer attributes for g_file_query_info() [gfo#36] + * service: use name instead of IP address with ad_server [rhbz#2129050] + * tools: add --do-not-touch-config option for AD [gfo#30] + * Use autoreconf and gettext + * samba: use new Samba-4.15 command line options [rhbz#2028530] + * syslog: avoid duplicate log messages [rhbz#2024248] + * ldap: add socket timeout [rhbz#1817869] + * Use target arch pkg-config to fix cross compilation [gfo#35] + * doc: add computer-name to realm man page + * configure: update some macros for autoconf-2.71 + * build: add --with-vendor-error-message configure option [rhbz#1889386] + * distro: use authselect on Red Hat platforms + +------------------------------------------------------------------- +Fri May 7 11:10:12 UTC 2021 - Ferdinand Thiessen + +- Update to version 0.17 + + Use current idmap options for smb.conf + + Find NetBIOS name in keytab while leaving + + Work properly with Python 3 + + discover: try to get domain name from hostname + + Set 'NEWEST' flag when resolving packages with PackageKit + + service: use "kerberos method" "secrets and keytab" + + Use startTLS with FreeIPA + + service: use 'additional dns hostnames' with net ads join + + Fix pam misconfiguration for SUSE systems + + Kerberos: add default_domain and udp_preference_limit + + tools: add --use-ldaps option for discover, join and leave + + Fix nsswitch handling when joining and leaving domain for + suse distro + + paths: install realmd in libexecdir + + tools: enforce absolute path for install option +- Drop upstream fixed 0001-suse-pam-settings.patch + +------------------------------------------------------------------- +Thu Sep 24 09:57:27 UTC 2020 - Samuel Cabrero + +- Adjust pam-config arguments for openSUSE; (bsc#1176053); + + Add 0001-suse-pam-settings.patch + +------------------------------------------------------------------- +Mon Jun 15 11:46:59 UTC 2020 - Dominique Leuenberger + +- Use proper unitdir macro to specify location of systemd units. + +------------------------------------------------------------------- +Wed Jan 22 11:01:28 UTC 2020 - Dominique Leuenberger + +- Adjust BuildRequires to allow OBS to shortcut through -mini + flavors: + + systemd -> pkgconfig(systemd) + + krb5-devel -> pkgconfig(krb5) + +------------------------------------------------------------------- +Wed Jul 19 22:17:10 UTC 2017 - plinnell@opensuse.org + +- https://bugzilla.suse.com/show_bug.cgi?id=916766 + and https://bugzilla.suse.com/show_bug.cgi?id=1048025 resolved. + +------------------------------------------------------------------- +Fri Dec 16 21:37:53 UTC 2016 - plinnell@suse.com + +- update to 0.16.3 +- some minor package tweaks +- Add rpmlint filter for polkit error - A temp fix until security + review is completed. + +Fri May 20 16:36:39 UTC 2016 - darin@darins.net + +- update to 0.16.2 + * Be more liberal with domain name chars + * Increase timeout when calling PackageKit + * List package names with spaces between them [#89464] + * Install to $prefix/lib instead of $libdir + + 0.16.1 + * libsystemd build fix [#90519] + * Change default home directory to /home/%U@%D + * Add --automatic-id-mapping=no command line argument + + 0.16.0 + * Disable automatic AD joins by default [#89205] + * Validate text we receive from LDAP + * Prefer adcli for AD joins + * Remove hard dependency on PackageKit + * Fix crash when empty password is used with realm client + +* Wed Apr 22 2015 kkaempf@suse.com +- update to 0.16.0 + * Disable automatic AD joins unless explicitly configured to + do so. This guarantees that mutual trust is established with + a domain that you are joining. + * Validate textual data discovered via LDAP before using them + in configuration files like samba.conf and sssd.conf +* Sun Feb 8 2015 kkaempf@suse.com +- update to 0.15.2 + * Bugfix release + * systemd support + * automake 1.14 support +* Tue Mar 25 2014 kkaempf@suse.com +- Upgrade to 0.14.5 + Bugfix release +* Thu May 16 2013 jmcdonough@suse.com +- Add docs and cleanup some build warnings +* Wed May 15 2013 jmcdonough@suse.com +- Check in 0.14.1 diff --git a/realmd.spec b/realmd.spec new file mode 100644 index 0000000..b5325a0 --- /dev/null +++ b/realmd.spec @@ -0,0 +1,109 @@ +# +# spec file for package realmd +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: realmd +Version: 0.17.1 +Release: 0 +Summary: AD integration detection +License: LGPL-2.1-or-later +Group: System/GUI/GNOME +URL: https://www.freedesktop.org/software/realmd/ +Source: https://gitlab.freedesktop.org/realmd/realmd/-/archive/%{version}/realmd-%{version}.tar.bz2 +Patch1: 0001-Create-parent-directory-for-sssd.conf-if-not-exists.patch +Patch2: 0002-Update-OpenSUSE-configuration.patch +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: gettext-tools +BuildRequires: glib2-devel >= 2.36 +BuildRequires: intltool +BuildRequires: libtool +BuildRequires: openldap2-devel +BuildRequires: pkgconfig +BuildRequires: polkit-devel +BuildRequires: samba-client +BuildRequires: xmlto +BuildRequires: pkgconfig(krb5) +BuildRequires: pkgconfig(systemd) +Recommends: %{name}-lang +%{?systemd_requires} + +%description +This packages contains realmd. + +Realmd is an on demand system DBus service, which allows +callers to configure network authentication and domain +membership in a standard way. realmd discovers information +about the domain or realm automatically and does not require +complicated configuration in order to join a domain or realm. + +realmd configures sssd or winbind to do the actual network +authentication and user account lookups. + +%lang_package + +%prep +%autosetup -p1 + +%build +NOCONFIGURE=1 sh ./autogen.sh +# krb5-config is hidden +PATH=$PATH:%{_prefix}/lib/mit/bin +%configure \ + --with-distro=suse \ + --with-systemd-journal=no \ + --with-systemd-unit-dir=%{_unitdir} \ + --with-private-dir=%{_libdir}/%{name} +%make_build + +%install +%make_install + +%find_lang %{name} +ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name} + +%pre +if [ -f %{_localstatedir}/lib/systemd/migrated/%{name} ]; then +%service_add_pre %{name}.service +fi + +%post +%service_add_post %{name}.service + +%preun +%service_del_preun %{name}.service + +%postun +%service_del_postun %{name}.service + +%files +%{_sbindir}/realm +%{_sbindir}/rc%{name} +%{_unitdir}/realmd.service +%{_libexecdir}/%{name} +%{_libdir}/%{name}/ +%config %{_sysconfdir}/dbus-1/system.d/org.freedesktop.realmd.conf +%{_datadir}/dbus-1/system-services/org.freedesktop.realmd.service +%{_datadir}/polkit-1/actions/org.freedesktop.realmd.policy + +%{_datadir}/doc/realmd +%{_mandir}/man5/realmd.conf.5%{?ext_man} +%{_mandir}/man8/realm.8%{?ext_man} + +%files lang -f %{name}.lang + +%changelog