Bug 16643 - sort in /etc/auto.net prevents mounting
Summary: sort in /etc/auto.net prevents mounting
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: autofs
Version: 7.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-08-20 16:44 UTC by Michal Jaegermann
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-08-20 16:44:15 UTC
Embargoed:


Attachments (Terms of Use)

Description Michal Jaegermann 2000-08-20 16:44:14 UTC
"New and improved" way of sorting breaks /etc/auto.net script from
'autofs' package.

On one of test machines I have the following output from 'showmount -e'
(don't ask, but it is valid :-):

/                   *.home.front
/usr                192.162.23.0/24
/home               192.162.23.0/24
/mnt/box/distro     192.162.23.0/24
/mnt/box/master     192.162.23.0/24
/mnt/box/master/usr 192.162.23.0/24

'auto.net' sorts that in the following way

/home               192.162.23.0/24
/                   *.home.front
/mnt/box/distro     192.162.23.0/24
/mnt/box/master     192.162.23.0/24
/mnt/box/master/usr 192.162.23.0/24
/usr                192.162.23.0/24

and none of exported directories gets mounted.  After the following
change (which likely reflects better what was intended anyway):

--- /etc/auto.net~	Fri Aug  4 12:39:05 2000
+++ /etc/auto.net	Sun Aug 20 10:15:15 2000
@@ -20,7 +20,7 @@
 # Newer distributions get this right
 SHOWMOUNT="showmount --no-headers -e $key"
 
-$SHOWMOUNT | sort +0 | \
+$SHOWMOUNT | sort -k 1,1 | \
 	awk -v key="$key" -v opts="$opts" -- '
 	BEGIN		{ ORS=""; print opts }
 			{ print " \\\n\t" $1, key ":" $1 }


this output of 'sort' becomes

/                   *.home.front
/home               192.162.23.0/24
/mnt/box/distro     192.162.23.0/24
/mnt/box/master     192.162.23.0/24
/mnt/box/master/usr 192.162.23.0/24
/usr                192.162.23.0/24

and everything mounts like it is supposed to.

Replacing "sort +0" with "LC_COLLATE=C sort +0" happens to work as
well but with unexpected characters in names may have other, unintended,
consequences.

  Michal
  michal

Comment 1 Nalin Dahyabhai 2000-08-21 14:00:58 UTC
Host map (auto.net) support in autofs 4 requires kernel features that won't show
up until 2.4.  Please test the autofs packages in
http://people.redhat.com/nalin/test/.  We're reverting to 3.1.5 for this release
because current autofs 4 snapshots don't expire directories correctly due to
recent kernel changes.


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