-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is the release script safe ? #46
Comments
Ah! But similar safeguards shoud probably be added in other places as well! Several missions do use Let's keep that open. |
Makes me wonder: can't we somehow set things up to run the game in a
|
That will probably open a whole lot of problems!
|
Probably a chroot is a safer way and can avoid #99 this ticket Or maybe every time the |
I could add a #!/bin/sh
GSH_ROOT=$(cd "$(dirname "$0")/.." && pwd -P)
for arg in "$@"
do
case "$arg" in
-*)
continue
;;
esac
case "$("$GSH_ROOT"/scripts/readlink-f "$arg")" in
"$GSH_ROOT"*)
continue
;;
*)
echo "safe_rm: cannot remove '$arg': it is not part of GameShell" >&2
exit 1
;;
esac
done
/bin/rm "$@" seems to work, but should probably be tested a little more. This offers some protection for uses of Of course, it doesn't help if the player redefines |
9479630 adds a "safe" rm script that does just that. It doesn't guarantee the release script is safe, but I don't think there can be such a guarantee! |
Line 77 of
gameshell.sh
isrm -rf "$GSH_ROOT"
where$GSH_ROOT
is defined as$ORIGINAL_DIR/$GSH_NAME
.Can there be a scenario leading to both
$ORIGINAL_DIR
and$GSH_NAME
definitions to fail, resulting in the execution ofrm -rf /
or something similar ? It might be a good idea to check that$GSH_ROOT
is different from/
and./
.Note that such a thing did happen with Valve's Steam install script : https://en.wikipedia.org/wiki/List_of_software_bugs#Video_gaming
The text was updated successfully, but these errors were encountered: