Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 574302

Summary: autofs cannot mount the folder name including "&".
Product: [Fedora] Fedora Reporter: Ian Kent <ikent>
Component: autofsAssignee: Ian Kent <ikent>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: high    
Version: 13CC: ikent, jmoyer, mmatsuya, tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: autofs-5.0.5-22.fc13 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 559796 Environment:
Last Closed: 2010-03-18 03:23:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 538274    
Attachments:
Description Flags
Patch - fix ampersand escape in auto.smb none

Description Ian Kent 2010-03-17 05:20:19 UTC
+++ This bug was initially created as a clone of Bug #559796 +++

Created an attachment (id=387477)
outputed with "logging=debug" in /etc/sysconfig/autofs

Description of problem:

autofs cannot mount the folder name including "&".

Version-Release number of selected component (if applicable):
autofs-5.0.1-0.rc2.131.el5_4.1

How reproducible:
Always

Steps to Reproduce:
1. The hidden share on windows server is //10.66.0.191/best & testing$.
2. Create /etc/auto.master, /etc/auto.misc and /etc/auto.cifs.10.66.0.191 

The content of auto.master:
--------------------------------
/misc   /etc/auto.misc
+auto.master
--------------------------------

The content of auto.misc is based on auto.smb, just include a little
modification:
--------------------------------
#!/bin/bash

# This file must be executable to work! chmod 755!

key="$1"
opts="-fstype=cifs"

if [ -e /etc/auto.cifs.$key ]; then
        opts=$opts,credentials=/etc/auto.cifs.$key
fi


for P in /bin /sbin /usr/bin /usr/sbin
do
        if [ -x $P/smbclient ]
        then
                SMBCLIENT=$P/smbclient
                break
        fi
done

[ -x $SMBCLIENT ] || exit 1

$SMBCLIENT -gNL $key 2>/dev/null| awk -v key="$key" -v opts="$opts" -F'|' -- '
        BEGIN   { ORS=""; first=1 }
        /Disk/  {
                  if (first)
                        print opts; first=0
                  dir = $2
                  loc = $2
                  # Enclose mount dir and location in quotes
                  # Double quote "$" in location as it is special
                  gsub(/\$$/, "\\$", loc);
                  print " \\\n\t \"/" dir "\"", "\"://" key "/" loc "\""
                }
        END     { if (!first) print "\n"; else exit 1 }
--------------------------------

The content of auto.cifs.10.66.0.191:
--------------------------------
username=administrator
password=redhat
--------------------------------

3. /etc/init.d/autofs restart
4. ls -la /opt/testing/10.2.68.13/best\ \&\ testing\$/

  
Actual results:
There is no output and the machine seems to be halted.

Expected results:
It can be mounted and accessed.

Comment 1 Ian Kent 2010-03-17 05:22:32 UTC
Created attachment 400634 [details]
Patch - fix ampersand escape in auto.smb

Comment 2 Fedora Update System 2010-03-17 05:41:29 UTC
autofs-5.0.5-22.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/autofs-5.0.5-22.fc13

Comment 3 Fedora Update System 2010-03-17 05:59:08 UTC
autofs-5.0.5-22.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/autofs-5.0.5-22.fc12

Comment 4 Fedora Update System 2010-03-18 03:22:58 UTC
autofs-5.0.5-22.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 5 Fedora Update System 2010-03-18 03:32:31 UTC
autofs-5.0.5-22.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.