From b2b4416387c3424380e5efcaa20e1a100406b8e1 Mon Sep 17 00:00:00 2001 From: Iker Pedrosa Date: Tue, 3 Oct 2023 09:59:47 +0200 Subject: [PATCH] useradd: Set proper SELinux labels for def_usrtemplate Signed-off-by: Iker Pedrosa --- ...seradd-def-usrtemplate-selinux-label.patch | 28 +++++++++++++++++++ shadow-utils.spec | 7 ++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 shadow-4.14.0-useradd-def-usrtemplate-selinux-label.patch diff --git a/shadow-4.14.0-useradd-def-usrtemplate-selinux-label.patch b/shadow-4.14.0-useradd-def-usrtemplate-selinux-label.patch new file mode 100644 index 0000000..97b709a --- /dev/null +++ b/shadow-4.14.0-useradd-def-usrtemplate-selinux-label.patch @@ -0,0 +1,28 @@ +From 48aa12af31c0b72872b411857d03a518a4200a3d Mon Sep 17 00:00:00 2001 +From: Johannes Segitz +Date: Tue, 26 Sep 2023 15:14:14 +0200 +Subject: [PATCH] useradd: Set proper SELinux labels for def_usrtemplate + +Fixes: 74c17c716 ("Add support for skeleton files from /usr/etc/skel") + +Signed-off-by: Johannes Segitz +--- + src/useradd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/useradd.c b/src/useradd.c +index 76a4d649..fe62a051 100644 +--- a/src/useradd.c ++++ b/src/useradd.c +@@ -2788,7 +2788,7 @@ int main (int argc, char **argv) + if (home_added) { + copy_tree (def_template, prefix_user_home, false, true, + (uid_t)-1, user_id, (gid_t)-1, user_gid); +- copy_tree (def_usrtemplate, prefix_user_home, false, false, ++ copy_tree (def_usrtemplate, prefix_user_home, false, true, + (uid_t)-1, user_id, (gid_t)-1, user_gid); + } else { + fprintf (stderr, +-- +2.41.0 + diff --git a/shadow-utils.spec b/shadow-utils.spec index 74f4ec6..49a7819 100644 --- a/shadow-utils.spec +++ b/shadow-utils.spec @@ -1,7 +1,7 @@ Summary: Utilities for managing accounts and shadow password files Name: shadow-utils Version: 4.14.0 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 2 License: BSD-3-Clause AND GPL-2.0-or-later URL: https://github.com/shadow-maint/shadow @@ -23,6 +23,8 @@ Patch0: shadow-4.14.0-manfix.patch Patch1: shadow-4.2.1-date-parsing.patch # Audit message changes - partially upstreamed Patch2: shadow-4.14.0-audit-update.patch +# https://github.com/shadow-maint/shadow/pull/812 +Patch3: shadow-4.14.0-useradd-def-usrtemplate-selinux-label.patch ### Dependencies ### Requires: audit-libs >= 1.6.5 @@ -261,6 +263,9 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/libsubid.a %{_libdir}/libsubid.so %changelog +* Tue Oct 3 2023 Iker Pedrosa - 2:4.14.0-2 +- useradd: Set proper SELinux labels for def_usrtemplate + * Wed Aug 16 2023 Iker Pedrosa - 2:4.14.0-1 - Rebase to version 4.14.0. Resolves: #2229000