[debian-lan-devel] [debian-lan] 05/05: Restore capabilities that get lost in the base.tar.xz archive.

Andreas B. Mundt andi at moszumanska.debian.org
Tue Oct 21 21:19:16 UTC 2014


This is an automated email from the git hooks/post-receive script.

andi pushed a commit to branch master
in repository debian-lan.

commit a1e7f40e0428e02a0472410e252f797981850816
Author: Andreas B. Mundt <andi at debian.org>
Date:   Tue Oct 21 20:36:31 2014 +0200

    Restore capabilities that get lost in the base.tar.xz archive.
---
 fai/config/scripts/DEBIAN/20-capabilities | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/fai/config/scripts/DEBIAN/20-capabilities b/fai/config/scripts/DEBIAN/20-capabilities
new file mode 100755
index 0000000..7de88d6
--- /dev/null
+++ b/fai/config/scripts/DEBIAN/20-capabilities
@@ -0,0 +1,18 @@
+#!/bin/bash
+#
+# Capabilities get lost when creating the fai base.tar.xz image.
+# Restore them here.
+#
+
+set -e
+
+if [ -x $target/sbin/setcap ] ; then
+    for FILE in /bin/ping /bin/ping6 /usr/bin/arping ; do
+        if [ -x $target/$FILE ] ; then
+            $ROOTCMD /sbin/setcap cap_net_raw+ep $FILE
+        fi
+    done
+    if [ -x $target/usr/bin/systemd-detect-virt ] ; then
+        $ROOTCMD /sbin/setcap cap_dac_override,cap_sys_ptrace+ep /usr/bin/systemd-detect-virt
+    fi
+fi

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/debian-lan.git



More information about the debian-lan-devel mailing list