Skip to content

Commit

Permalink
Upgrade for nix PATH changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorNelson committed Jul 11, 2024
1 parent d43ae74 commit f31c6b7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
5 changes: 5 additions & 0 deletions access-control/.init
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ for i in $NEED_SETUID
do
chmod u+s "$i"
done

if [ -e /challenge/.path ]; then
mkdir -p /challenge/bin
ln -sf "$(cat /challenge/.path)" /challenge/bin/
fi
1 change: 1 addition & 0 deletions access-control/level-4/.path
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/cat
1 change: 1 addition & 0 deletions access-control/level-5/.path
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/cp
5 changes: 0 additions & 5 deletions access-control/run
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,7 @@ def level4():
print("Before:")
os.system(f"/bin/ls -la /bin/cat")

# create a symlink
os.chmod("/bin/cat", 0o4755)
os.mkdir("/challenge/bin")
os.symlink("/bin/cat", "/challenge/bin/cat")

print("After:")
os.system(f"/bin/ls -la /bin/cat")
Expand All @@ -259,8 +256,6 @@ def level5():
os.system(f"/bin/ls -la /bin/cp")

os.chmod("/bin/cp", 0o4755)
os.mkdir("/challenge/bin")
os.symlink("/bin/cp", "/challenge/bin/cp")

print("After:")
os.system(f"/bin/ls -la /bin/cp")
Expand Down

0 comments on commit f31c6b7

Please sign in to comment.