#!/bin/bash

# Script to test capabilities, comment to enable
# capsh in debian package: libcap2-bin
# Require root

D="cap_audit_control"
D="${D},cap_audit_read"
D="${D},cap_audit_write"
D="${D},cap_block_suspend"
D="${D},cap_chown"
D="${D},cap_dac_override"
D="${D},cap_dac_read_search"
D="${D},cap_fowner"
D="${D},cap_fsetid"
D="${D},cap_ipc_lock"
D="${D},cap_ipc_owner"
D="${D},cap_kill"
D="${D},cap_lease"
D="${D},cap_linux_immutable"
D="${D},cap_mac_admin"
D="${D},cap_mac_override"
D="${D},cap_mknod"
D="${D},cap_net_admin"
D="${D},cap_net_bind_service"
D="${D},cap_net_broadcast"
D="${D},cap_net_raw"
D="${D},cap_setfcap"
D="${D},cap_setgid"
D="${D},cap_setpcap"
D="${D},cap_setuid"
D="${D},cap_sys_admin"
D="${D},cap_sys_boot"
D="${D},cap_sys_chroot"
D="${D},cap_syslog"
D="${D},cap_sys_module"
D="${D},cap_sys_nice"
D="${D},cap_sys_pacct"
D="${D},cap_sys_ptrace"
D="${D},cap_sys_rawio"
D="${D},cap_sys_resource"
D="${D},cap_sys_time"
D="${D},cap_sys_tty_config"
D="${D},cap_wake_alarm"
D="${D},cap_perfmon"
D="${D},cap_checkpoint_restore"
D="${D},cap_bpf"

/usr/sbin/capsh --noamb --drop=${D} -- -c "$1"
