#!/bin/bash ##CageFS proxyexec wrapper - ver 16 if [[ $EUID -eq 0 ]]; then echo 'Cannot be run as root' exit 1 fi USR=`/usr/bin/whoami` TOKEN=`/bin/cat /var/.cagefs/.cagefs.token` # It's user's tmp directory and write to it is secure procedure # because this script is running only under usual user PIDFILE="/tmp/.cagefs.proxy.$$" USER_INTERRUPT=13 CWD=`pwd` ctrl_c_handler() { if [[ -f "$PIDFILE" ]]; then pid=`/bin/cat $PIDFILE` /bin/rm -f $PIDFILE > /dev/null 2>&1 /bin/kill -s SIGINT "$pid" > /dev/null 2>&1 fi exit $USER_INTERRUPT } if [[ -e /var/.cagefs/origin ]]; then ORIGIN=`/bin/cat /var/.cagefs/origin` REMOTE="/usr/bin/ssh -F /etc/ssh/cagefs-rexec_config $USR@$ORIGIN" $REMOTE CAGEFS_TOKEN="$TOKEN" /usr/sbin/proxyexec -c cagefs.sock "$USR" "$CWD" PASSWD $$ "$@" RETVAL=$? else trap 'ctrl_c_handler' 2 CAGEFS_TOKEN="$TOKEN" /usr/sbin/proxyexec -c cagefs.sock "$USR" "$CWD" PASSWD $$ "$@" RETVAL=$? /bin/rm -f $PIDFILE > /dev/null 2>&1 fi exit $RETVAL
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
4ff13095f38570f905b2d63b29a1a14c9cbb0f | File | 1.02 KB | 0755 |
|
5d5a42f18fe481ea97ae16c15685431aff00da | File | 216.37 KB | 0755 |
|
File | 0 B | 0 |
|
|
6f666de8e8f0c429391e1f4b190b665ff917c2 | File | 94.03 KB | 0755 |
|
893dcf29b96945b3589635a2442ac66bddd6da | File | 49.98 KB | 0755 |
|
a6191b33199ce29926c2b06311d176de0f7195 | File | 24.28 KB | 0755 |
|
abb89cc5eb31c82f6d6426e79c02907354ef58 | File | 21.89 KB | 0755 |
|
c39049efdc00ad57b7544282814de65b23c22e | File | 30.14 KB | 0755 |
|
c8e8d82f1a97fbc343712ce77bd7748cb03ac1 | File | 9.89 MB | 0755 |
|
File | 0 B | 0 |
|
|
fa30b8cc521c53a3f0fa1e8863cf17acea8728 | File | 2.08 MB | 0755 |
|
fc2938a130a0428f58080c1efa0b5b4daba547 | File | 32.48 KB | 0755 |
|