set SUID bit on busybox
[busybox-power] / debian / busybox-power.postinst
index 2e6b89b..9c4a8c0 100644 (file)
@@ -4,7 +4,12 @@ set -e
 /opt/busybox-power/busybox.power sh /opt/busybox-power/install-binary.sh
 
 # Workaround for bug 5317
-if ! grep -q "trap exit SIGHUP SIGINT SIGTERM" /home/user/.profile; then
-  echo "trap exit SIGHUP SIGINT SIGTERM #by busybox-power" >> /home/user/.profile
+line="trap exit SIGHUP #by busybox-power"
+if ! grep -F -q "$line" /etc/profile; then
+  echo "$line" >> /etc/profile
 fi
 
+# Set SUID bit on /bin/busybox. Privileges are automatically dropped for 
+# applets that do not require the SUID bit to be set
+chmod u+s /bin/busybox 
+