aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2022-05-02 19:58:56 +0100
committerDaniel Golle <daniel@makrotopia.org>2022-05-03 20:32:38 +0100
commit6cb08b17979c93a7cc086127786ee813b3775783 (patch)
tree39bc2a811dc9e4316581bd546c33421d3e8ca8ef /package/base-files/files
parent9282cb0be06c103b229d5f4555c7a2b0448f58fe (diff)
downloadupstream-6cb08b17979c93a7cc086127786ee813b3775783.tar.gz
upstream-6cb08b17979c93a7cc086127786ee813b3775783.tar.bz2
upstream-6cb08b17979c93a7cc086127786ee813b3775783.zip
base-files: add missing $IPKG_INSTROOT to restorecon call
Update to overlooked v2 version of Dominick Grift's patch. Fixes: 5109bd164c ("base-files: address sed in-place without SELinux awareness") Signed-off-by: Daniel Golle <daniel@makrotopia.org> (cherry picked from commit 6d7272852e0b2634b2fa93a131ea8659ec87f079)
Diffstat (limited to 'package/base-files/files')
-rw-r--r--package/base-files/files/lib/functions.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index 9db0871d6c..da2dd5b346 100644
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -386,7 +386,9 @@ 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
- selinuxenabled 2>/dev/null && restorecon /etc/group
+ if [ -x /usr/sbin/selinuxenabled ] && selinuxenabled; then
+ selinuxenabled 2>/dev/null && restorecon ${IPKG_INSTROOT}/etc/group
+ fi
[ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/passwd
}