Bug 2025509

Summary: Autofs auto.smb awk script fails on shares with dollar signs
Product: Red Hat Enterprise Linux 8 Reporter: robbe.vanlerberghe
Component: autofsAssignee: Ian Kent <ikent>
Status: CLOSED ERRATA QA Contact: Kun Wang <kunwan>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.7CC: xzhou
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: autofs-5.1.4-77.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-10 15:29:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description robbe.vanlerberghe 2021-11-22 12:02:29 UTC
In windows, a share that ends with a dollar sign is a hidden share.
Using autofs, the provided auto.smb script fails on these, as it incorrectly adds a quote for the trailing dollar of these special Windows mounts. But they are already surrounded by double quotes.

This is fixed in autofs 5.1.7, but not in the current rhel8 version (5.1.4-74).

It would be nice if this fix could be pushed to the rhel 8 (and possibly rhel 7) release(s). Granted, it's an example script but it is confusing and  timeconsuming to figure it out, and the bug has been there since 2016...

See also the Fedora and Ubuntu bugtrackers:

https://bugzilla.redhat.com/show_bug.cgi?id=1409103
https://bugs.launchpad.net/ubuntu/+source/autofs/+bug/1680224

Change needed:

/etc/auto.smb:
@@ -76,7 +76,7 @@
     loc = $2
     # Enclose mount dir and location in quotes
- # Double quote "$" in location as it is special
- gsub(/\$$/, "\\$", loc);
- gsub(/\&/,"\\\\&",loc)
     print " \\\n\t \"/" dir "\"", "\"://" key "/" loc "\""

Comment 1 Ian Kent 2021-11-22 13:20:06 UTC
I can apply the upstream patch for that to RHEL-8, it's already in the coming
RHEL-9.

But RHEL-7 is past general bug fix maintenance so we would need a sound
business case for that.

Also we don't normally back port changes to earlier releases, again a
business case is needed and it's a bit of a high bar to get things
accepted.

Comment 2 robbe.vanlerberghe 2021-11-22 13:24:11 UTC
Ok, I'll take the RHEL-8. Thanks!

Comment 11 errata-xmlrpc 2022-05-10 15:29:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (autofs bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2084