Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nsswitch.conf may contain comment at end of line #517

Closed
pmhahn opened this issue Oct 27, 2017 · 1 comment
Closed

nsswitch.conf may contain comment at end of line #517

pmhahn opened this issue Oct 27, 2017 · 1 comment

Comments

@pmhahn
Copy link

pmhahn commented Oct 27, 2017

From 35de0cd724826bc02d4727b1d2cda6e18e89d2bd Mon Sep 17 00:00:00 2001
Message-Id: <35de0cd724826bc02d4727b1d2cda6e18e89d2bd.1509107750.git.hahn@univention.de>
From: Philipp Hahn <hahn@univention.de>
Date: Fri, 27 Oct 2017 14:05:07 +0200
Subject: [PATCH] nsswitch.conf: Handle EOL comment #517
Organization: Univention GmbH, Bremen, Germany

nsswitch.conf database statements may contain comments at end of line.
---
 lenses/nsswitch.aug            | 2 +-
 lenses/tests/test_nsswitch.aug | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/lenses/nsswitch.aug b/lenses/nsswitch.aug
index 2d65345a..5f9e7171 100644
--- a/lenses/nsswitch.aug
+++ b/lenses/nsswitch.aug
@@ -69,7 +69,7 @@ let database =
        . (Build.opt_list
             (service|reaction)
             Sep.space)
-       . Util.eol ]
+       . Util.comment_or_eol ]
 
 (* View: lns *)
 let lns = ( empty | comment | database )*
diff --git a/lenses/tests/test_nsswitch.aug b/lenses/tests/test_nsswitch.aug
index c9c57472..b467cf77 100644
--- a/lenses/tests/test_nsswitch.aug
+++ b/lenses/tests/test_nsswitch.aug
@@ -8,6 +8,7 @@ networks:       nis [!UNAVAIL=return success=continue] files
 protocols:      db files
 netgroup:       nis
 bootparams: nisplus [NOTFOUND=return] files
+aliases:        files # uses by mail
 sudoers:        files ldap
 "
 
@@ -44,6 +45,9 @@ test Nsswitch.lns get conf =
            { "status" = "NOTFOUND"
                { "action" = "return" } } }
       { "service" = "files" } }
+   { "database" = "aliases"
+      { "service" = "files" }
+      { "#comment" = "uses by mail" } }
    { "database" = "sudoers"
       { "service" = "files" }
       { "service" = "ldap" } }
-- 
2.11.0
@lutter lutter closed this as completed in 9295df4 Oct 28, 2017
@lutter
Copy link
Member

lutter commented Oct 28, 2017

Thanks a ton for the patch !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants