CIFS network filesystem manager: better use / instead of \

When creating CIFS mounts, Webmin uses the \\servername\sharename syntax. While this is basically correct, and the usual notation under Windows, there is an issue with that under Ubuntu.

A CIFS mount with a subdirectory, like \\server\share\path, fails to mount at boot time, with some "syntax error in share name: does not start with \ or \" error. Manually mounting it subsequently in a shell does work.

When using //server/share/path instead, it works correctly also at boot time, also without "path".

So, while I'm not sure whether this is an Ubuntu issue, maybe it'd be an idea to have Webmin use forward slashes in this case.

On another note, Webmin incorrectly splits the mount target into the edit boxes "Server name" and "Share name": \\server\share ends up in "Server name", and path ends up in "Share name".

I suppose the developers did not reckon so far that some weird guys want to use CIFS mounts with path names behind the share. ;)



Thanks - I didn't know that an extra \ in a path was allowed .. I'll fix that in the next Webmin release.

However, the use of \ seems legitimate to me ..

Yeah, the "\" should be correct... but indeed there's an issue with that under Ubuntu, as outlined.

Example. Having this in /etc/fstab

\\backup-frank\ara  /mnt/backup  cifs  password=SECRET,username=frank  0  0

Results in this error during boot:

mount error: improperly formatted UNC name. \\backup-frank\ara does not begin with \\ or // No ip address specified and hostname not found mountall: mount /mnt/backup [717] terminated with status 1

It is possible that this is rather a bug in the Ubuntu/Debian start scripts, since:

  • mounting that share after boot works, no matter if I use \ or /

  • mounting that share works if I use /, both at boot and later

  • mounting shares with share name only (no path) works at boot and later, with \ or /

But, the issue here is: Even when I manually have put "/" in fstab to work around this bug, Webmin will convert it back to \ when editing the mount.

I did some more testing on this, and realized that Webmin is already using forward-slash paths in /etc/fstab for SMBFS and CIFS mounts, at least on my system ..

Do you still see the wrong slash used if you add a mount that doesn't have a sub-directory path?

Mmh.. Yes, it does not matter if you have a sub-directory or not.

Indeed when creating a CIFS mount, it does use forward slashes. But as soon as you edit the mount (and actually change the server or share name), it switches them to backslashes.