Compare commits

..

No commits in common. "3dbd507717e1e97ff6cfa46686c566e8a30a431f" and "79daaeb6542f99a395bc5d32f837f33f99f8c73a" have entirely different histories.

6 changed files with 36 additions and 112 deletions

View File

@ -1,58 +0,0 @@
From 1efff28faef83a620fd7f6eaac3fe64ee6691a33 Mon Sep 17 00:00:00 2001
From: Jiri Kucera <jkucera@redhat.com>
Date: Apr 10 2020 09:18:42 +0000
Subject: Merge #7 `Do not use deprecated flask.h and av_permissions.h`
---
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 <selinux/selinux.h>
-#include <selinux/flask.h>
-#include <selinux/av_permissions.h>
#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) {

View File

@ -0,0 +1,24 @@
From c5a0bfd174e4a88fcd49fe7a130b37b6779c1a18 Mon Sep 17 00:00:00 2001
From: Jiri Kucera <jkucera@redhat.com>
Date: Aug 07 2018 14:10:07 +0000
Subject: Include <sys/sysmacros.h> manually
Inclusion of <sys/sysmacros.h> from <sys/types.h>
is now deprecated
---
diff --git a/usermount.c b/usermount.c
index 3aafadd..5875c09 100644
--- a/usermount.c
+++ b/usermount.c
@@ -40,6 +40,7 @@
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
+#include <sys/sysmacros.h>
#include <errno.h>
#include <glob.h>
#include <libintl.h>

View File

@ -1,2 +0,0 @@
USER=root
UGROUPS=wheel

Binary file not shown.

Binary file not shown.

View File

@ -1,20 +1,20 @@
Name: usermode
Version: 1.113
Release: 4
Version: 1.112
Release: 7
Summary: Tools for certain user account management tasks
License: GPLv2+
URL: https://pagure.io/usermode/
Source: https://releases.pagure.org/usermode/usermode-%{version}.tar.xz
Source1: config-util
Patch0: Do-not-use-deprecated-flask.h-and-av_permissions.patch
Source: https://releases.pagure.org/usermode/usermode-%{version}.autotoolized.tar.xz
Patch0000: Include-sys-sysmacros.h-manually.patch
Requires: pam passwd util-linux
BuildRequires: gcc
BuildRequires: desktop-file-utils gettext intltool perl-XML-Parser util-linux
BuildRequires: glib2-devel gtk2-devel libblkid-devel libSM-devel libselinux-devel libuser-devel
BuildRequires: pam-devel startup-notification-devel
Provides: %{name}-gtk = %{version}-%{release}
Obsoletes: %{name}-gtk < %{version}-%{release}
%description
usermode contains the userhelper program, which can be used to allow configured
programs to be run with superuser privileges by ordinary users, and several
@ -23,19 +23,6 @@ graphical tools for users:
* usermount lets users mount, unmount, and format filesystems.
* userpasswd allows users to change their passwords.
%package gtk
Summary: Graphical tools for certain user account management tasks
Requires: %{name} = %{version}-%{release}
%description gtk
The usermode-gtk package contains several graphical tools for users:
userinfo, usermount and userpasswd. Userinfo allows users to change
their finger information. Usermount lets users mount, unmount, and
format file systems. Userpasswd allows users to change their
passwords.
Install the usermode-gtk package if you would like to provide users with
graphical tools for certain account management tasks.
%package help
Summary: Man pages for usermode
@ -48,21 +35,19 @@ Package help includes man pages for usermode.
%build
%configure --with-selinux
%make_build VENDOR=%{_vendor}
%make_build VENDOR=openeuler
%install
%make_install VENDOR=%{_vendor}
%make_install VENDOR=openeuler
# make userformat symlink to usermount
%{__ln_s} usermount %{buildroot}%{_bindir}/userformat
%{__ln_s} usermount.1 %{buildroot}%{_mandir}/man1/userformat.1
install -D -p -m 644 %{SOURCE1} %{buildroot}/etc/security/console.apps/config-util
for i in %{_vendor}-userinfo.desktop %{_vendor}-userpasswd.desktop %{_vendor}-usermount.desktop; do
for i in openeuler-userinfo.desktop openeuler-userpasswd.desktop openeuler-usermount.desktop; do
echo 'NotShowIn=GNOME;KDE;' >>%{buildroot}%{_datadir}/applications/$i
desktop-file-install --vendor %{_vendor} --delete-original \
desktop-file-install --vendor openeuler --delete-original \
--dir %{buildroot}%{_datadir}/applications \
%{buildroot}%{_datadir}/applications/$i
done
@ -72,18 +57,8 @@ done
%files -f %{name}.lang
%doc COPYING ChangeLog NEWS README
%attr(4711,root,root) /usr/sbin/userhelper
%{_bindir}/consolehelper
%{_bindir}/*
%{_datadir}/usermode
%config(noreplace) /etc/security/console.apps/config-util
%files gtk
%{_bindir}/usermount
%{_bindir}/userformat
%{_bindir}/userinfo
%{_bindir}/userpasswd
%{_bindir}/consolehelper-gtk
%{_bindir}/pam-panel-icon
%{_datadir}/%{name}
%{_datadir}/pixmaps/*
%{_datadir}/applications/*
@ -92,21 +67,6 @@ done
%{_mandir}/man8/*
%changelog
* Tue Jun 11 2024 zhangruifang <zhangruifang@h-partners.com> - 1.113-4
- modify openeuler to _vendor
* Thu Sep 16 2021 wangjie <wangjie375@huawei.com> - 1.113-3
- segregated usermode-gtk
* Thu May 27 2021 panxiaohe <panxiaohe@huawei.com> - 1.113-2
- Add gcc to BuildRequires
* Wed Aug 26 2020 Hugel <gengqihu1@huawei.com> - 1.113-1
- update to 1.113
* Tue Mar 17 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.112-8
- Add Source1
* Sat Jan 4 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.112-7
- Delete redundant file