From 76346b911b21d8b2f2a9a19a6a2071d73a1936f1 Mon Sep 17 00:00:00 2001 From: Jiri Kucera Date: Wed, 5 May 2021 02:04:28 +0200 Subject: [PATCH] Update to usermode-1.114 --- .gitignore | 1 + selinux_deprecated.patch | 49 ---------------------------------------- sources | 2 +- usermode.spec | 34 ++++++++++++++++++++-------- 4 files changed, 27 insertions(+), 59 deletions(-) delete mode 100644 selinux_deprecated.patch diff --git a/.gitignore b/.gitignore index 936ca2d..0e2dc37 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ usermode-1.105.tar.xz /usermode-1.112.tar.xz /usermode-1.112.autotoolized.tar.xz /usermode-1.113.tar.xz +/usermode-1.114.tar.xz diff --git a/selinux_deprecated.patch b/selinux_deprecated.patch deleted file mode 100644 index fbce502..0000000 --- a/selinux_deprecated.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/userhelper.c b/userhelper.c -index 4177c89..f2afde7 100644 ---- a/userhelper.c -+++ b/userhelper.c -@@ -48,8 +48,6 @@ - - #ifdef WITH_SELINUX - #include --#include --#include - #endif - - #include "shvar.h" -@@ -111,7 +109,7 @@ static int checkAccess(unsigned int selaccess) { - struct av_decision avd; - int retval = security_compute_av(user_context, - user_context, -- SECCLASS_PASSWD, -+ string_to_security_class("passwd"), - selaccess, - &avd); - -@@ -2267,7 +2265,8 @@ main(int argc, char **argv) - const char *new_home_phone; - const char *new_shell; - #ifdef WITH_SELINUX -- unsigned perm; -+ security_class_t class; -+ access_vector_t perm; - #endif - - /* State variable we pass around. */ -@@ -2426,12 +2425,13 @@ main(int argc, char **argv) - user_name = g_strdup(argv[optind]); - - #ifdef WITH_SELINUX -+ class = string_to_security_class("passwd"); - if (c_flag) -- perm = PASSWD__PASSWD; -+ perm = string_to_av_perm(class, "passwd"); - else if (s_flag) -- perm = PASSWD__CHSH; -+ perm = string_to_av_perm(class, "chsh"); - else -- perm = PASSWD__CHFN; -+ perm = string_to_av_perm(class, "chfn"); - - if (is_selinux_enabled() > 0 && - checkAccess(perm)!= 0) { diff --git a/sources b/sources index ee6f411..5065b51 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (usermode-1.113.tar.xz) = 0653da8cff94b86bd67ca1bed50bb77a929f5da1c047e6c627273fc319cc3bf6df7c5af1b5be160b2068632199d194bd00bcf43f702927a34b884149800c7f21 +SHA512 (usermode-1.114.tar.xz) = 703eb218704c7a11cdce25a71f4fc91bf4f042a8b185f79f3954699081c0db8a6234ad6f11738d8b2fe6a492a03d029cbe01762a47869edc473e4fbaa6e0ee32 diff --git a/usermode.spec b/usermode.spec index 39433d7..5e07f58 100644 --- a/usermode.spec +++ b/usermode.spec @@ -1,26 +1,31 @@ +# Add `--without gtk' option (enable gtk by default): +%bcond_without gtk + Summary: Tools for certain user account management tasks Name: usermode -Version: 1.113 +Version: 1.114 Release: 1%{?dist} License: GPLv2+ URL: https://pagure.io/%{name}/ Source: https://releases.pagure.org/%{name}/%{name}-%{version}.tar.xz Source1: config-util -# Backport of 48c4085004caad1ec928fa103b7f3e3fe684c826 -# - and are now deprecated -Patch0: selinux_deprecated.patch Requires: pam, passwd, util-linux # https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/IJFYI5Q2BYZKIGDFS2WLOBDUSEGWHIKV/ BuildRequires: make BuildRequires: gcc -BuildRequires: desktop-file-utils, gettext, glib2-devel, gtk2-devel, intltool -BuildRequires: libblkid-devel, libSM-devel, libselinux-devel, libuser-devel -BuildRequires: pam-devel, perl-XML-Parser, startup-notification-devel +BuildRequires: gettext, glib2-devel, intltool +%if %{with gtk} +BuildRequires: desktop-file-utils, gtk2-devel, startup-notification-devel, libSM-devel +%endif +BuildRequires: libblkid-devel, libselinux-devel, libuser-devel +BuildRequires: pam-devel, perl-XML-Parser BuildRequires: util-linux +%if %{with gtk} %package gtk Summary: Graphical tools for certain user account management tasks Requires: %{name} = %{version}-%{release} +%endif %global _hardened_build 1 @@ -29,6 +34,7 @@ The usermode package contains the userhelper program, which can be used to allow configured programs to be run with superuser privileges by ordinary users. +%if %{with gtk} %description gtk The usermode-gtk package contains several graphical tools for users: userinfo, usermount and userpasswd. Userinfo allows users to change @@ -38,27 +44,30 @@ passwords. Install the usermode-gtk package if you would like to provide users with graphical tools for certain account management tasks. +%endif %prep %setup -q -%patch0 -p1 %build -%configure --with-selinux +%configure --with-selinux %{!?with_gtk:--without-gtk} %make_build %install %make_install INSTALL='install -p' +%if %{with gtk} # make userformat symlink to usermount ln -sf usermount $RPM_BUILD_ROOT%{_bindir}/userformat ln -s usermount.1 $RPM_BUILD_ROOT%{_mandir}/man1/userformat.1 +%endif mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps install -p -m 644 %{SOURCE1} \ $RPM_BUILD_ROOT/etc/security/console.apps/config-util +%if %{with gtk} for i in redhat-userinfo.desktop redhat-userpasswd.desktop \ redhat-usermount.desktop; do echo 'NotShowIn=GNOME;KDE;' >>$RPM_BUILD_ROOT%{_datadir}/applications/$i @@ -66,6 +75,7 @@ for i in redhat-userinfo.desktop redhat-userpasswd.desktop \ --dir $RPM_BUILD_ROOT%{_datadir}/applications \ $RPM_BUILD_ROOT%{_datadir}/applications/$i done +%endif %find_lang %{name} @@ -78,6 +88,7 @@ done %{_mandir}/man8/consolehelper.8* %config(noreplace) /etc/security/console.apps/config-util +%if %{with gtk} %files gtk %{_bindir}/usermount %{_mandir}/man1/usermount.1* @@ -94,8 +105,13 @@ done %{_datadir}/%{name} %{_datadir}/pixmaps/* %{_datadir}/applications/* +%endif %changelog +* Tue May 04 2021 Jiri Kucera - 1.114-1 +- Update to usermode-1.114 +- Allow to optionally disable GTK + * Mon May 03 2021 Jiri Kucera - 1.113-1 - Update to usermode-1.113