Bug 1841476 - auto.smb fails to mount SMB/CIFS shares that end with '$'
Summary: auto.smb fails to mount SMB/CIFS shares that end with '$'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: autofs
Version: 32
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Ian Kent
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-29 09:00 UTC by Richard Guest
Modified: 2020-06-27 02:06 UTC (History)
1 user (show)

Fixed In Version: autofs-5.1.6-7.fc32
Clone Of:
Environment:
Last Closed: 2020-06-27 02:06:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Richard Guest 2020-05-29 09:00:26 UTC
Description of problem:
auto.smb fails to mount SMB/CIFS shares that end with a '$', but explicit entries e.g. in /etc/auto.misc work fine.

It appears that the '$' character escaping isn't working.

Version-Release number of selected component (if applicable):
autofs-5.1.6-4.fc32.x86_64


How reproducible:
100%

Steps to Reproduce:
1. Follow the steps to enable as described in /etc/auto.smb:
# Put a line like the following in /etc/auto.master:
# /cifs  /etc/auto.smb --timeout=300
# You'll be able to access Windows and Samba shares in your network
# under /cifs/host.domain/share


Actual results:
cd /cifs/host.domain/share$
bash: cd: /cifs/host.domain/share$: No such file or directory

Expected results:
ll /cifs/host.domain/testshare2/
total 0
-rwxr-xr-x. 1 username username 0 Jan 15 14:52  hello.txt
drwxr-xr-x. 2 username username 0 Jan 15 14:52 'New folder'

Alternatively, similar to an explicit entry in e.g. /etc/auto.misc:
share$ -fstype=cifs,credentials=/etc/creds/host.domain,uid=$UID,gid=$GID ://host.domain/share\$

cd /misc/share$
ll
total 0
-rwxr-xr-x. 1 username username 0 Jan 15 14:22  success.txt


Additional info:
$ smbclient -u=username -W=WORKGROUP -gL host.domain
Enter WORKGROUP\username's password: 
Disk|share$|Share
Disk|testshare2|Other share



$ sudo automount -f -v
Starting automounter version 5.1.6-4.fc32, master map auto.master
using kernel protocol version 5.05
setautomntent: lookup(sss): setautomntent: No such file or directory
mounted indirect on /misc with timeout 300, freq 75 seconds
mounted indirect on /net with timeout 300, freq 75 seconds
mounted indirect on /cifs with timeout 300, freq 75 seconds
attempting to mount entry /cifs/host.domain
>> awk: cmd. line:11: warning: regexp escape sequence `\&' is not a known regexp operator
mounted offset on /cifs/host.domain/share$ with timeout 300, freq 75 seconds
mounted offset on /cifs/host.domain/testshare2 with timeout 300, freq 75 seconds
mounted /cifs/host.domain
attempting to mount entry /cifs/host.domain/share$
>> mount error(2): No such file or directory
>> Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
mount(generic): failed to mount //host.domain/share\$ (type cifs) on /cifs/host.domain/share$
failed to mount /cifs/host.domain/share$

$ dmesg | tail
[296985.595803] CIFS: Attempting to mount //host.domain/share\$
[296985.595892] No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
[296985.853442] CIFS VFS:  BAD_NETWORK_NAME: \\host.domain/share
[296985.869302] CIFS VFS: cifs_mount failed w/return code = -2

Comment 1 Richard Guest 2020-05-29 09:11:31 UTC
For what it's worth, if I apply the following change, the cifs mount works just fine:

$ diff -u /etc/auto.smb.orig /etc/auto.smb
--- /etc/auto.smb.orig	2020-05-29 21:07:58.462419021 +1200
+++ /etc/auto.smb	2020-05-29 21:08:38.626128477 +1200
@@ -76,7 +76,7 @@
 		  loc = $2
 		  # Enclose mount dir and location in quotes
 		  # Double quote "$" in location as it is special
-		  gsub(/\\$$/, d"\\$", loc);
+		  #gsub(/\\$$/, d"\\$", loc);
 		  gsub(/\&/,"\\\\&",loc)
 		  print " \\\n\t \"/" dir "\"", "\"://" key "/" loc "\""
 		}


However, I have no idea what impact this change might have on shares with a '$' in the middle of the share name.

Comment 2 Ian Kent 2020-05-29 10:13:44 UTC
Ok, some of that commentary looks like the behviour is a bit odd.
I'll have a look.

Comment 3 Fedora Update System 2020-06-22 01:33:53 UTC
FEDORA-2020-c08e86fe8b has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-c08e86fe8b

Comment 4 Fedora Update System 2020-06-23 01:04:49 UTC
FEDORA-2020-c08e86fe8b has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-c08e86fe8b`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-c08e86fe8b

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2020-06-27 02:06:46 UTC
FEDORA-2020-c08e86fe8b has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.