aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2022-05-02 21:07:16 +0100
committerDaniel Golle <daniel@makrotopia.org>2022-05-03 20:32:48 +0100
commit0dc3ecf0da1c609b44a180555a0aac40bea79c7b (patch)
treea768ce08608c575d13be32590659c7aa9073d668 /package/base-files
parentefc38b315e9bd59ab69ca212b7e444d4537260cc (diff)
downloadupstream-0dc3ecf0da1c609b44a180555a0aac40bea79c7b.tar.gz
upstream-0dc3ecf0da1c609b44a180555a0aac40bea79c7b.tar.bz2
upstream-0dc3ecf0da1c609b44a180555a0aac40bea79c7b.zip
base-files: simplify restorecon logic
Remove forgotten redundant selinuxenabled call and skip the whole thing in case $IPKG_INSTROOT is set as labels are anyway applied only later on in fakeroot when squashfs is created. Fixes: 6d7272852e ("base-files: add missing $IPKG_INSTROOT to restorecon call") Signed-off-by: Daniel Golle <daniel@makrotopia.org> (cherry picked from commit 7b07c3cff57f057d6780d34adeb23c06123732db)
Diffstat (limited to 'package/base-files')
-rw-r--r--package/base-files/files/lib/functions.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index da2dd5b346..4b1b838572 100644
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -386,8 +386,8 @@ group_add_user() {
echo "$grp" | grep -q ":$" && delim=""
[ -n "$IPKG_INSTROOT" ] || lock /var/lock/passwd
sed -i "s/$grp/$grp$delim$2/g" ${IPKG_INSTROOT}/etc/group
- if [ -x /usr/sbin/selinuxenabled ] && selinuxenabled; then
- selinuxenabled 2>/dev/null && restorecon ${IPKG_INSTROOT}/etc/group
+ if [ -z "$IPKG_INSTROOT" ] && [ -x /usr/sbin/selinuxenabled ] && selinuxenabled; then
+ restorecon /etc/group
fi
[ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/passwd
}