The auto.net script that comes with autofs is broken
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
autofs (Ubuntu) |
Fix Released
|
Undecided
|
Kees Cook |
Bug Description
Binary package hint: autofs
The /etc/auto.net script that comes with the autofs package breaks if the server exports filesystems with different permissions to different clients, which is an extremely common thing to do in an enterprise environment. With the existing autofs version of auto.net, the /net map simply doesn't work in this configuration. Consider the following output:
# /sbin/showmount --no-headers -e nfs-server
/tools *
/tools adminclient
This happens because the server is configured to export the filesystem with different permissions depending on the client; for example in a common situation the "adminclient" would have root privileges on the filesystem while the other clients (matching "*") would not.
The /etc/auto.net script parses this up into output that automount wants, as follows:
# /etc/auto.net nfs-server
-fstype=
/tools nfs-server:/tools \
/tools nfs-server:/tools
This doesn't work, though, because there are two entries for that mount point and automount just ignores them both (I suppose):
# ls /net/nfs-
ls: /net/nfs-
It looks to me like the script *tries* to get rid of duplicates by running through sort -u -k1, but that's obviously not enough; even though the first key is identical, sort doesn't omit lines unless the entire line is duplicated not just the key (even if you give -k1). I believe that what you want is to use cut first to grab just the first item, then sort -u, like this:
$SHOWMOUNT | LC_ALL=C cut -d\ -f1 | LC_ALL=C sort -u \
After I make this change to /etc/auto.net and restart, my /net map for this system works properly.
Changed in autofs: | |
assignee: | nobody → mok0 |
status: | New → In Progress |
Changed in autofs: | |
assignee: | nobody → keescook |
Changed in autofs: | |
status: | Fix Released → Fix Committed |
This is still broken in Hardy.
It doesn't seem like anyone is looking at autofs bugs for Ubuntu. Does anyone actually maintain this package?