Pod always fails with "cifs mount: failed to mount the network path: mount error(13): Permission denied" when the password contains an exclamation mark (!)
ddprince17 opened this issue · 2 comments
The issue seems related to the fact that bash interprets exclamation marks because of the history expansion: https://superuser.com/questions/133780/in-bash-how-do-i-escape-an-exclamation-mark.
If I use a user that do not have an exclamation mark in their password, the command works correctly.
The best way to debug this is to uncomment these lines at the top of the script:
# echo >> /tmp/cifs.log
# date >> /tmp/cifs.log
# echo "$@" >> /tmp/cifs.log
Then you should see in /tmp/cifs.log
the parameters Kubernetes used when calling the script, and you can reproduce the same call in the command line without Kubernetes. If you add some echo
commands for cifsPasswordBase64
, cifsPassword
and the mount
command you will see what the script does with the password and where the error with the exclamation mark occurs.
I had the same error with a $ in my password. The problem was the base64 encoding! In the setup instructions there is a command
echo -n password | base64
Instead use
echo -n "password" | base64
This worked like a charm.