[augeas-devel] [PATCH] Pam: allow '-' before type

David Lutterkort lutter at redhat.com
Mon Oct 19 13:30:03 UTC 2009


The type field in a pam.d file can start with a '-' to indicate that
missing the module should not cause an error. The '-' is now mapped into
the tree as a separate node 'optional'

Bug reported by Shannon Hughes
---
 lenses/pam.aug            |    1 +
 lenses/tests/test_pam.aug |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/lenses/pam.aug b/lenses/pam.aug
index ff1726a..c0bc045 100644
--- a/lenses/pam.aug
+++ b/lenses/pam.aug
@@ -27,6 +27,7 @@ module Pam =
                   Util.del_ws_spc . store word . eol ]
 
   let record = [ seq "record" . indent .
+                   [ label "optional" . del "-" "-" ]? .
                    [ label "type" . store types ] .
                    Util.del_ws_tab .
                    [ label "control" . store control] .
diff --git a/lenses/tests/test_pam.aug b/lenses/tests/test_pam.aug
index 0db4a92..e0abfcc 100644
--- a/lenses/tests/test_pam.aug
+++ b/lenses/tests/test_pam.aug
@@ -33,6 +33,14 @@ session    optional     pam_keyinit.so force revoke
   test Pam.lns get "@include common-password\n" =
     { "include" = "common-password" }
 
+  test Pam.lns get "-password   optional	pam_gnome_keyring.so\n" =
+    { "1"
+      { "optional" }
+      { "type" = "password" }
+      { "control" = "optional" }
+      { "module" = "pam_gnome_keyring.so" }
+    }
+
 (* Local Variables: *)
 (* mode: caml       *)
 (* End:             *)
-- 
1.6.2.5




More information about the augeas-devel mailing list