autofs cannot mount remote directory path with space
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
autofs (Ubuntu) |
Confirmed
|
Low
|
Unassigned |
Bug Description
Binary package hint: autofs
System info:
Description: Ubuntu 8.04.1
Release: 8.04
autofs:
Installed: 4.1.4+debian-
Candidate: 4.1.4+debian-
Version table:
*** 4.1.4+debian-
500 http://
100 /var/lib/
Autofs fails to mount a remote file system if the remote path contains a space. On the remote NFS server, syslog reports that it can't stat exported dir and then prints the requested remote path ending at (before) the space. There is no way to use autofs to mount a remote directory containing a space through any combination of quoting or escaping. Using command-line "mount" command works fine when the remote path is quoted. Autofs calls the "mount" command for the actual mounting operation, so the problem is in autofs's preparation of the remote path argument to "mount".
Cause: in autofs source file mount_nfs.c, in function get_best_mount(), remote path is copied until space or end of string. If the remote path contains a space, the string is terminated before the space. This shortened string is then passed to the "mount" program as the remote path to be mounted on the local mount point.
To duplicate:
1) Export a file system on the remote system, and make a directory underneath the top level of the exported file system that contains a space. Example:
remote% cat /etc/exports
/export
remote% mkdir "/export/data/path with space"
2) On the local system, set up an automount map that maps to the remote file system, and start autofs. Mount map example:
local% cat /etc/auto.master
/data /etc/auto.data defaults,intr
local%cat /etc/auto.data
* remote:
3) Attempt to access the local path:
local% ls "/data/path with space"
/bin/ls: cannot access /data/path with space: No such file or directory
On the remote machine's syslog:
Dec 8 16:25:24 remote nss_wins[801]: can't stat exported dir /export/data/path: No such file or directory
Hi,
I was wondering if you were still having this problem?
Thanks
chuck