Skip to content

Trouble with CIFS mount with $ in the middle (and worse with spaces) #231

@ThimoNeubauer

Description

@ThimoNeubauer

Let me start by saying that I think that the breaking change #206 is something I welcome (it just arrived in our setup). In most of the places I could just remove our additional quoting. A statement like

fs   => '://fileserver.foo/Patches$'

works as expected. The first trouble I notice was with

fs   => '://fileserver.foo/latest$/CD-Images'

No quoting was applied, the generated map

latest_cdimages -fstype=cifs,vers=2.1,credentials=...   ://fileserver.foo/latest$/CD-Images

however could not be mounted. This might be a quirk of autofs in RHEL 8.10, the kernel logged:

Aug 29 11:15:11 r22lininst kernel: CIFS: VFS:  BAD_NETWORK_NAME: \\fileserver.foo\latest

The workaround I found was to quote the dollar like this:

fs   => '://fileserver.foo/latest\\$/CD-Images'

This generates:

latest_studio   -fstype=cifs,vers=2.1,credentials=...     ://fileserver.foo/latest\$/Studio

which works in practice. Note that the dollar sign wasn't a problem in the first example: the problem only seems to appear when it isn't at the end.

Now the worst case:

fs   => '://fileserver.foo/latest$/Clean Install',

Reasonably enough the generated map looks like this:

latest_cleaninstall     -fstype=cifs,vers=2.1,credentials=...       "://fileserver.foo/latest$/Clean Install"

There's a space in the path, hence surrounding quotes. I also need to escape the dollar sign though for the mount to really work. But if I do that then the generated map is:

latest_cleaninstall     -fstype=cifs,vers=2.1,credentials=...       "://fileserver.foo/latest\\\$/Clean Install"

which doesn't work. And now I'm stuck :-(

Let me add that I hate the Windows tradition to "hide" stuff by appending a trailing dollar sign. But it's the reality I find in my company...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions