Nimdy / Dedicated_Valheim_Server_Script

Valheim Server Manager . Supports: ValheimPlus, Bepinex, Multi-world, Multi-Lang, Update, Backup, Restore and more: Built for Linux
GNU Affero General Public License v3.0
697 stars 120 forks source link

[BUG] Missing file hardening required. #259

Closed unixtreme closed 3 years ago

unixtreme commented 3 years ago

Describe the bug Needs additional hardening for missing files, as well as /dev/null redirections.

Example of running on an uninstalled server:

Can't open /home/steam/valheimserver/start_valheim.sh: No such file or directory. Can't open /home/steam/valheimserver/start_valheim.sh: No such file or directory. Can't open /home/steam/valheimserver/start_valheim.sh: No such file or directory. Can't open /home/steam/valheimserver/start_valheim.sh: No such file or directory. Can't open /home/steam/valheimserver/start_valheim.sh: No such file or directory. find: '/home/steam/valheimserver/officialvalheimbuild': No such file or directory /installer/menu.sh: line 1074: /home/steam/steamcmd: No such file or directory /installer/menu.sh: line 1075: /home/steam/valheimserver/officialvalheimbuild: No such file or directory chown: invalid user: 'steam:steam'

To Reproduce Just run it on an unconfigured system, docker example:

Note: you'll need to manually install git and curl in the container unless you use the changes in my last Pull Request.

docker run -it -v "$(pwd)":/installer/ ubuntu:bionic /installer/menu.sh

Even more alarming is that failing to load the language file yields no errors and the script just keeps going.

Expected behavior If a file that is not required fails to load the user shouldn't see the error message (redirect to /dev/null). If a file that is required fails to load (e.g. language file) the script should stop and provide an error message.

Nimdy commented 3 years ago

Thanks for the submission.

We are currently working on the new menu... Please view it here:

https://github.com/Nimdy/Dedicated_Valheim_Server_Script/blob/beta/njordmenu.sh