Bug 172694 - Defines not getting expanded
Defines not getting expanded
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: autofs (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeffrey Moyer
Brock Organ
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-08 09:48 EST by Bastien Nocera
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-01-09 17:14:55 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bastien Nocera 2005-11-08 09:48:10 EST
Same thing happens with autofs-4.1.3-155 on RHEL4

+++ This bug was initially created as a clone of Bug #172692 +++

autofs-4.1.3-158

When using defines in the auto.master, the variables that require shell
expansion aren't getting substituted.
For example, in auto.master:
/mnt/testnfs /etc/auto.testnfs -D OSREL=RHEL-4 -D OSUPDATE=U2 -D OSVER=AS -D
OSARCH=`uname -i`

And in auto.testnfs:
current -ro,hard,intr,wsize=8192,rsize=8192
testnfs.devel.redhat.com:/vol/devarchive/redhat/released/$OSREL/$OSUPDATE/$OS
VER/$OSARCH/tree

You will get errors such as:

Nov  7 09:03:22 localhost automount[4017]: >> mount:
testnfs.devel.redhat.com:/vol/devarchive/redhat/released/RHEL-4/U2/AS/`uname/
tree failed, reason given by server: Permission denied

The patch below evaluates the additional options so that shell commands can be
expanded as necessary

-- Additional comment from bnocera@redhat.com on 2005-11-08 09:46 EST --
Created an attachment (id=120813)
autofs-eval-options.patch
Comment 1 Jeffrey Moyer 2005-11-08 13:31:00 EST
Shell expansion is not supported in autofs configuration files.  If you want
shell expansion, try using a program map.
Comment 3 Jeffrey Moyer 2005-11-10 13:54:33 EST
This functionality is neither documented nor supported.  I understand the
"preserve functionality, bug for bug," mentality, but the ability to do this is
going away in the next release of our operating system, anyway.

The following variables are defined by default:

ARCH	The application architecture is derived from the output of uname -m
CPU	The output of uname -p

Why can't the customer use one of these?
Comment 4 Chris Kloiber 2005-11-10 14:23:02 EST
Customer's original auto.* files are attached to the IT#, but basically they
have different versions of their custom application for particular arch and base
kernel version, so they are doing a claculation like:

-D OSREL=`uname -r | sed s/-[0-9.]*/-/

Which will return '2.4.21' on any RHEL-3 kernel. So basically they need more
flexibility than just ARCH and CPU.

Customer was reporting this against RHEL-3, but copying comment to this RHEL-4
ticket for the sake of completness as the regression occurs here too.
Comment 5 Jeffrey Moyer 2005-11-10 14:46:25 EST
Why was this changed to MODIFIED?  I'm moving it back to ASSIGNED, with a note
that I'm still not convinced that this is something which should be "fixed."
Comment 7 Jeffrey Moyer 2006-01-09 17:14:55 EST
an automounter map is a configuration file.  It simply does not support shell
expansion.  Yes, it happened to work in previous versions, but it will not
continue to work in the future.

Have the customer try to use program maps to generate custom variables.

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