Skip to content

Commit 64f3200

Browse files
committed
prune away setuid execution
Signed-off-by: Anand Avati <[email protected]>
1 parent ca6e86f commit 64f3200

File tree

6 files changed

+5
-18
lines changed

6 files changed

+5
-18
lines changed

dq-free

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
D=$(cd `dirname $0` && pwd)
44

5-
exec $D/dq-on-all gpu-free
5+
exec $D/dq-on-all shell -pc gpu-free

dq-users

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function disp {
1313
exit
1414
}
1515

16-
$D/dq-on-all gpu-users | {
16+
$D/dq-on-all shell -pc gpu-users | {
1717
trap disp SIGINT
1818

1919
while read line; do

install.sh

-13
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@ D=$(cd `dirname $0` && pwd)
1111

1212
#DIR=$1
1313

14-
function install_fix {
15-
SRC=$1; shift
16-
DST=$1; shift
17-
echo "#!$DIR/shell -p" > $SRC.fix
18-
tail -n +2 $SRC >> $SRC.fix
19-
install $SRC.fix $DST $@
20-
rm -f $SRC.fix
21-
}
22-
2314
install $D/dq-on-all $DIR/dq-on-all -D -m 0755
2415
install $D/dq-submit $DIR/dq-submit -D -m 0755
2516
install $D/dq-prepare $DIR/dq-prepare -D -m 0755
@@ -42,10 +33,6 @@ install $D/dq-users $DIR/dq-users -D -m 0755
4233
install $D/dq-env.sh $DIR/dq-env.sh -D -m 0644
4334
install $D/dq-env.csh $DIR/dq-env.csh -D -m 0644
4435
install /bin/bash $DIR/shell -D -o root -g $GROUP -m 06550
45-
install /usr/bin/screen $DIR/screen -D -o root -g $GROUP -m 06750
4636
install $D/scripts/helper-on-all $DIR/scripts/helper-on-all -D -m 0755
47-
install_fix $D/scripts/gpu-users $DIR/scripts/gpu-users -D -m 0755
48-
install_fix $D/scripts/gpu-free $DIR/scripts/gpu-free -D -m 0755
49-
install_fix $D/scripts/gpu-free-list $DIR/scripts/gpu-free-list -D -m 0755
5037

5138
chmod g+w $DIR

scripts/gpu-free

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!shell -p
1+
#!/bin/bash
22

33
h=$(hostname -s)
44
gpus=$(nvidia-smi -L | cut -f1 -d: | cut -f2 -d' ')

scripts/gpu-free-list

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!shell -p
1+
#!/bin/bash
22

33
h=$(hostname -s)
44
gpus=$(nvidia-smi -L | cut -f1 -d: | cut -f2 -d' ')

scripts/gpu-users

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!shell -p
1+
#!/bin/bash
22

33
h=$(hostname -s)
44
dump=$(lsof -n /dev/nvidia? 2>/dev/null | sed -r -e 's/[ \t]+/ /g' | grep "CHR")

0 commit comments

Comments
 (0)