Tracking entry for a VMS specific issue in util_str.c/string_sub() The $ character has a different meaning in OpenVMS DCL shell commands than with UNIX, and substituting an underscore for it can cause failures. In OpenVMS, the presence of a $ in a filename, environment symbol, or other system resource name is used to indicate that the use of that name is reserved to OpenVMS designated uses, and it prevents name space collisions. Of course because the bash shell is optionally available on OpenVMS, consideration may be needed to prevent exploits, if this is what the string substitution is suppose to prevent.
While there are still relatively recent efforts to compile Samba on OpenVMS (I found an almost-successful effort on 4.3: http://www.ccsscorp.com/VMSblog/index.php?m=05&y=16&entry=entry160521-083131 ), I sadly don't think that we can safely make such an exception for OpenVMS. Sorry!