Skip to contentSkip to conversation

Allow period in -Dvariable=value flags in auto.master

DISCUSSION Mike Matera 2 participants 2 messages Apr 19, 2007 – Apr 20, 2007 Kernel automounter

lore
Share & tools
lore
#0 lore raw

Hi,

In order to use autofs on my company network I must override OSNAME, ARCH and OSREL to match other Linux boxes. Previous automount allowed the following line in auto.master:

/stuff yp:auto.stuff -DOSNAME=Linux -DARCH=i686 -DOSREL=2.4

This stopped working on my FC6 box (autofs-5.0.1-0.rc3.10) because the parser choked on the '.' in 2.4. I couldn't find anyone else who'd run into this problem so I made a patch to master_tok.l that allows periods in the variable values.

All I did was add '\.' to the character class on the right side of the equal sign in the MACROSTR rule. The code is shown below:

MACROSTR (-D{OPTWS}([[:alpha:]_]([[:alnum:]_\-])*)=([[:alnum:]_\-\.])+)

Cheers
./m

maintainer
#1 lore raw
Quoted 13 lines · Mike Matera

Hi,

In order to use autofs on my company network I must override OSNAME, ARCH and OSREL to match other Linux boxes. Previous automount allowed the following line in auto.master:

/stuff yp:auto.stuff -DOSNAME=Linux -DARCH=i686 -DOSREL=2.4

This stopped working on my FC6 box (autofs-5.0.1-0.rc3.10) because the parser choked on the '.' in 2.4. I couldn't find anyone else who'd run into this problem so I made a patch to master_tok.l that allows periods in the variable values.

Quoted 4 lines

All I did was add '\.' to the character class on the right side of the equal sign in the MACROSTR rule. The code is shown below:

MACROSTR (-D{OPTWS}([[:alpha:]_]([[:alnum:]_\-])*)=([[:alnum:]_\-\.])+)

Ha .. an obvious omission on my part.
Will fix, thanks.

I wonder why others haven't seen this?
I'm sure a lot of people use macros like this.

Ian