Skip to contentSkip to conversation

Which version to uses, nsswitch.conf parse errors

DISCUSSION Marc Weber 2 participants 4 messages Apr 28, 2009 – Apr 29, 2009 Kernel automounter

lore
Share & tools
lore

Marc Weber

author
#0 lore raw

Hi at all,

I'd like to add some automount support to the nixos linux distribution. however I don't know exactly which version to I should use?

automount v5 (autfs4 kernel module (?)) or automount v4?

For now I've tried v5. However when starting automount I get some parse errors:

[...]
--accepting rule at line 92 ("
")
--accepting rule at line 92 ("
")
--accepting rule at line 87 ("automount:") --accepting rule at line 95 (" ")
--accepting rule at line 97 ("files")
syntax error in nsswitch config near [ syntax error ]

My nsswitch.conf is attached below.

It looks to me like the lexer ignoring everything until it reaches a ^automount line?

Should I stick to the older automount version?
Maybe you can help me understand the problem so that I can try improving the error message?

I've built the 9a77464b git version.

Thanks
Marc Weber

My nsswitch.conf:

psswd:         ldap files
group:          ldap files
shadow:         ldap files
hosts:          files dns
networks:       files dns
services:       files
protocols:      files

automount: files nis

maintainer
#1 lore raw
Quoted 6 lines · Marc Weber

Hi at all,

I'd like to add some automount support to the nixos linux distribution. however I don't know exactly which version to I should use?

automount v5 (autfs4 kernel module (?)) or automount v4?

Version 5 has nsswitch support.

The kernel module used should be autofs4.

The reason for the name is historic but autofs4 supports autofs kernel protocols v3, v4 and v5 whereas the autofs module supports autofs kernel protocol v3.

Quoted 14 lines

For now I've tried v5. However when starting automount I get some parse errors:

[...]
--accepting rule at line 92 ("
")
--accepting rule at line 92 ("
")
--accepting rule at line 87 ("automount:") --accepting rule at line 95 (" ")
--accepting rule at line 97 ("files")
syntax error in nsswitch config near [ syntax error ]

Quoted 5 lines

My nsswitch.conf is attached below.

It looks to me like the lexer ignoring everything until it reaches a ^automount line?

Well, yes it's looking for automount map sources, what else would you expect?

Quoted 2 lines

Should I stick to the older automount version?

Don't think so. There's no nsswitch support in v4 and v4 is getting limited attention these days.

Quoted 2 lines

Maybe you can help me understand the problem so that I can try improving the error message?

Most of the time the message reflects the part of the line the message occurred at but, if the parser gets an error at a point that doesn't have text for the token it just prints the above.

The error handling in the lex/yacc (Flex/Bison actually) parser is painful to the max. While that may well be my poor implementation the fact that I ended up with a poor implementation after so much effort is a problem in itself.

The question of whether to expand the use of a parser generator to the rest of the parsing in autofs or to re-write the whole lot with a manually crafted lexer and parser is still undecided.

Quoted 2 lines

I've built the 9a77464b git version.

Right, that's fairly recent.
The nsswitch.conf below looks OK to me and the parse works fine for me here on an entry formatted the same way.

Quoted 22 lines

Thanks
Marc Weber

My nsswitch.conf:

psswd:         ldap files
group:          ldap files
shadow:         ldap files
hosts:          files dns
networks:       files dns
services:       files
protocols:      files

automount: files nis

_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs

maintainer
#2 lore raw
In reply to Marc Weber
Quoted 10 lines · Marc Weber

Hi at all,

I'd like to add some automount support to the nixos linux distribution. however I don't know exactly which version to I should use?

automount v5 (autfs4 kernel module (?)) or automount v4?

For now I've tried v5. However when starting automount I get some parse errors:

Quoted 9 lines

[...]
--accepting rule at line 92 ("
")
--accepting rule at line 92 ("
")
--accepting rule at line 87 ("automount:") --accepting rule at line 95 (" ")
--accepting rule at line 97 ("files")
syntax error in nsswitch config near [ syntax error ]

This probably results from not having a <NL> at the end of the line. It's not a simple matter to deal with this invalid input as we read the nsswitch input from a stream and <EOF> needs to be handled by the parser not the rules.

Ian

author
#3 lore raw

Hi Ian,

Indeed you'r right. There wasn't a \n at the end.
I was sure I tried that. I did. I must have messed something up while playing with the parser. the syntax clearly states source NL; I'll do some further investigation.
Using automount compiled by the system there is no error anymore. Strange. Anyway thanks to your great support!

Marc Weber