diff options
author | cubercsl | 2022-09-29 22:10:20 +0800 |
---|---|---|
committer | cubercsl | 2022-09-29 22:10:20 +0800 |
commit | 2db73692a6924060900cb74eb1f187e1cb602437 (patch) | |
tree | a523fb2085563ad1ca8c4dea53ee08285566d33d /gg-cap | |
parent | 8da4c826207eb2b71466edc5d13947b97e24343c (diff) | |
download | aur-2db73692a6924060900cb74eb1f187e1cb602437.tar.gz |
[lilac] updated to 0.2.13-3
Diffstat (limited to 'gg-cap')
-rw-r--r-- | gg-cap | 33 |
1 files changed, 20 insertions, 13 deletions
@@ -15,16 +15,23 @@ error() { exit 1 } -ptrace_scope=$(cat /proc/sys/kernel/yama/ptrace_scope) - -case $ptrace_scope in - 2) - warn "Your ptrace_scope is 2, give the correct capability to gg." - /usr/bin/setcap cap_net_raw,cap_sys_ptrace+ep /usr/bin/gg - ;; - 3) - error "Your kernel does not allow ptrace permission, gg may not work." - ;; - *) - echo "No need to setcap." -esac +if [[ -f /proc/sys/kernel/yama/ptrace_scope ]]; then + ptrace_scope=$(cat /proc/sys/kernel/yama/ptrace_scope) + case $ptrace_scope in + 2) + warn "Your ptrace_scope is 2, give the correct capability to +gg." + /usr/bin/setcap cap_net_raw,cap_sys_ptrace+ep /usr/bin/gg + ;; + 3) + error "Your kernel does not allow ptrace permission, gg may not +work." + ;; + *) + echo "No need to setcap." + esac +else + warn "YAMA support is not enabled in the kernel, still setting +capabilities..." + /usr/bin/setcap cap_net_raw,cap_sys_ptrace+ep /usr/bin/gg +fi |