guardicore / monkey

Infection Monkey - An open-source adversary emulation platform
https://www.guardicore.com/infectionmonkey/
GNU General Public License v3.0
6.62k stars 772 forks source link

Bug with deployment script linux #1108

Closed VakarisZ closed 3 years ago

VakarisZ commented 3 years ago

Tasks:

Describe the bug

Documentation of deployment script for Linux describes usage as ./deploy_linux.sh "/home/user/new" "master". When I tried command ./deploy_linux.sh "~/infection_monkey_deployment_test" "pipenv", a new directory "~" was created in a working directory, inside it infection_monkey_deployment_test dir was created. Either documentation is bad or there's a bug with directory creation

Machine version (please complete the following information):

mssalvatore commented 3 years ago

After @ilija-lazoroski did some work to locate the issue, it seems that this isn't really a bug. When you put your path, including the tilde, in quotes, bash does not perform tilde expansion and instead treats the string you gave it as a literal. This is by design, and the behavior of deploy_linux.sh is consistent with bash's behavior.

The two options for working around this are:

  1. Don't use quotes if you want to use tilde expansion.
  2. Use $HOME instead of a tilde if you want to use quotes.
mssalvatore commented 3 years ago

Quotes were removed from the documentation to avoid confusion.