puppet-augeasproviders icon indicating copy to clipboard operation
puppet-augeasproviders copied to clipboard

pam.conf not parsing

Open nanliu opened this issue 10 years ago • 2 comments

I tried to manage pam.conf on solaris and the provider seems really confused about what lns to use:

Error: /Stage[main]/Ldap::Config/Pam[login pam_ldap.so.1]: Could not evaluate: Augeas didn't load /etc/pam.conf with pam.lns from /var/opt/lib/pe-puppet/lib/augeas/lenses: Iterated lens matched less than it should (line:19, character:0)

If I force pam provider to use the pamconf.lns it will work, but clearly breaks pam.d

lens do
  'pamconf.lns'
end

After further debugging resource is nil and does not appear to be passed in:

  lens do |resource|
    target(resource) == '/etc/pam.conf' ? 'pamconf.lns' : 'pam.lns'
  end

I'm able to trace the call, but unclear if lens is initialized correctly since resource is always nil, and I'm expecting to have some data so target(resource) will match '/etc/pam.conf', but that never seems to happen.

nanliu avatar Aug 05 '14 23:08 nanliu

The code for detecting resource_path is also failing when I switch the lens to pamconf.lns:

/augeas/files/etc/pam.conf/error/message = Failed to match
    { /service/ = /[.0-9A-Z_a-z-]+/ }{ /optional/ }?{ /type/ = /auth|session|account|password/ }{ /control/ = /\\[[^]\001-\004\n#]*\\]|[^\001-\004\t [][^\001-\004\t ]*/ }{ /module/ = /[^\001-\004\t\n #]+/ }{ /argument/ = /[^\001-\004\t\n #]+/ }*({ /#comment/ = /[^\001-\004\t\n\r ][^\001-\004\n]*[^\001-\004\t\n\r ]|[^\001-\004\t\n\r ]/ } | ())
  with tree
    { "type" = "auth" } { "control" = "required" } { "module" = "pam_ldap.so.1" }

nanliu avatar Aug 06 '14 16:08 nanliu

Can you get your file through augcheck to see if Augeas is able to parse it, please?

raphink avatar Nov 17 '14 14:11 raphink