docker-volume-netshare icon indicating copy to clipboard operation
docker-volume-netshare copied to clipboard

Shell-unsafe characters in .netrc file are not escaped

Open dleehr opened this issue 8 years ago • 3 comments

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.

dleehr avatar Mar 11 '16 16:03 dleehr

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

gondor avatar Mar 11 '16 18:03 gondor

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.

bmocm avatar Feb 23 '17 13:02 bmocm

This should be fixed upstream in the netrc library.

jose-fully-ported avatar Jan 12 '24 18:01 jose-fully-ported