Bug 16643

Summary: sort in /etc/auto.net prevents mounting
Product: [Retired] Red Hat Linux Reporter: Michal Jaegermann <michal>
Component: autofsAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-08-20 16:44:15 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:

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.