Skip to content

Commit

Permalink
update babysuid - only copy target if not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
robwaz committed Jul 22, 2024
1 parent 97cb32d commit 38dde7b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion program-misuse/babysuid
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,6 @@ restart this challenge container to make sure that I set the SUID bit!

if not os.path.exists("/challenge/bin"):
os.makedirs("/challenge/bin")
assert shutil.copy2(shutil.which(utility), f"/challenge/bin/{utility}")
if not os.path.isfile(f"/challenge/bin/{utility}"):
assert shutil.copy2(shutil.which(utility), f"/challenge/bin/{utility}")
os.chmod(f"/challenge/bin/{utility}", 0o4755)

0 comments on commit 38dde7b

Please sign in to comment.