Bug#1032014: setupcon: do not copy security attribute
Package: console-setup
Version: 1.217
User: selinux-devel@lists.alioth.debian.org
Usertags: selinux
Tags: patch
When copying files into the temporary working directory do not copy
the security context but use the default one for the target path.
Otherwise, e.g. when using SELinux, the context might not be allowed
on the destination filesystem and the process needs elevated access to
the original context.
diff --git a/setupcon b/setupcon
index 50139a8e06c63fd14df4a6ec204e45a1aa563fe2..ac06c473cc0647183d7ca5d937595665cdb68efc
100755
--- a/setupcon
+++ b/setupcon
@@ -1213,7 +1213,7 @@ if [ "$setupdir" ]; then
f="${f%.gz}"
case "$arg" in
*.gz) zcat "$arg"
>"$setupdir/etc/console-setup/$f" ;;
- *) cp -a "$arg"
"$setupdir/etc/console-setup/$f" ;;
+ *) cp -aZ "$arg"
"$setupdir/etc/console-setup/$f" ;;
esac
printf "%s" "/etc/console-setup/$f" \
| sed "s/'/\'\\\\\'\'/g"
Reply to: