Ian Kent f5c313
autofs-5.0.7 - Allow nsswitch.conf to not contain "automount:" lines
Ian Kent f5c313
Ian Kent f5c313
From: Michael Tokarev <mjt@tls.msk.ru>
Ian Kent f5c313
Ian Kent f5c313
Current code does not allow a case when nsswitch.conf
Ian Kent f5c313
does not mention automount map at all, like all new
Ian Kent f5c313
installations.  It logs a rather unpleasant error
Ian Kent f5c313
message instead:
Ian Kent f5c313
Ian Kent f5c313
 syntax error in nsswitch config near [ syntax error ]
Ian Kent f5c313
Ian Kent f5c313
this patch has a minimal fix, to allo "file" to be empty.
Ian Kent f5c313
Ian Kent f5c313
Whole parser in C is about 25 lines of code, the "grammar"
Ian Kent f5c313
is trivial, and it is better to ditch all this yacc/lex
Ian Kent f5c313
stuff, but that will be much more intrusive change.
Ian Kent f5c313
Ian Kent f5c313
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Ian Kent f5c313
Cc: 682266@bugs.debian.org
Ian Kent f5c313
---
Ian Kent f5c313
Ian Kent f5c313
 CHANGELOG       |    1 +
Ian Kent f5c313
 lib/nss_parse.y |    1 +
Ian Kent f5c313
 2 files changed, 2 insertions(+), 0 deletions(-)
Ian Kent f5c313
Ian Kent f5c313
Ian Kent f5c313
diff --git a/CHANGELOG b/CHANGELOG
Ian Kent f5c313
index bd0dd82..16ac2a0 100644
Ian Kent f5c313
--- a/CHANGELOG
Ian Kent f5c313
+++ b/CHANGELOG
Ian Kent f5c313
@@ -16,6 +16,7 @@
Ian Kent f5c313
 - increase file map read buffer size.
Ian Kent f5c313
 - handle new location of systemd.
Ian Kent f5c313
 - fix map entry duplicate offset detection.
Ian Kent f5c313
+- Allow nsswitch.conf to not contain "automount:" lines.
Ian Kent f5c313
 
Ian Kent f5c313
 25/07/2012 autofs-5.0.7
Ian Kent f5c313
 =======================
Ian Kent f5c313
diff --git a/lib/nss_parse.y b/lib/nss_parse.y
Ian Kent f5c313
index a39fda4..055e9d7 100644
Ian Kent f5c313
--- a/lib/nss_parse.y
Ian Kent f5c313
+++ b/lib/nss_parse.y
Ian Kent f5c313
@@ -72,6 +72,7 @@ file: {
Ian Kent f5c313
 		nss_debug = YYDEBUG;
Ian Kent f5c313
 #endif
Ian Kent f5c313
 	} sources NL
Ian Kent f5c313
+	| /* empty */
Ian Kent f5c313
 	;
Ian Kent f5c313
 
Ian Kent f5c313
 sources: nss_source