cifs icon indicating copy to clipboard operation
cifs copied to clipboard

Pod always fails with "cifs mount: failed to mount the network path: mount error(13): Permission denied" when the password contains an exclamation mark (!)

Open ddprince17 opened this issue 5 years ago • 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.

ddprince17 avatar Mar 22 '19 03:03 ddprince17

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.

fstab avatar Apr 02 '19 20:04 fstab

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.

kfehrenbach avatar May 06 '20 05:05 kfehrenbach