fstab / cifs

CIFS Flexvolume Plugin for Kubernetes
MIT License
212 stars 49 forks source link

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

Open ddprince17 opened 5 years ago

ddprince17 commented 5 years ago

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.

fstab commented 5 years ago

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.

kfehrenbach commented 4 years ago

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.