docker-volume-netshare
docker-volume-netshare copied to clipboard
Shell-unsafe characters in .netrc file are not escaped
If I have a password with characters such as $
or %
in my .netrc file, docker-volume-netshare does not correctly provide the password to mount.cifs command. I've found that I need to backslash-escape the characters in the .netrc file so that they are safe in the mount command.
Do you mind filing this with the maintainer of the netrc library? If they are inactive about fixing this I will bring in something else or write our own. Let me know.
github.com/dickeyxxx/netrc
I do not think this is an issue with .netrc processing. The same issue occurs if you pass the options in on the command line. The shell expansion is happening in the run utility function. The function uses 'sh -c' to execute the mount command triggering shell expansion of the mount options. This is surprising bahaviour and in the case of a password with special shell characters can easily lead to the account being locked out. At a minimum this should be documented. I am not sure of the use case though of shell expansion in this context. Perhaps a better fix is to call the mount command directly rather than go through the shell.
This should be fixed upstream in the netrc library.