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

pam provider ignores password-auth #105

Closed
wants to merge 1 commit into from
Closed

pam provider ignores password-auth #105

wants to merge 1 commit into from

Conversation

raphink
Copy link
Member

@raphink raphink commented Jun 2, 2014

I have configuration like this

class add_radius_config {
  pam { "Add radius authentication to system-auth":
    ensure => present,
    service => "system-auth",
    type => "auth",
    module => "pam_radius_auth.so",
    position => "after module pam_env.so",
    arguments => ["try_first_pass", "localifdown", "conf=/etc/sysconfig/raddb", "client_id=tacacs"],
    control => "sufficient"
  }

  pam { "Add radius authentication password-auth":
    ensure => present,
    service => "password-auth-ac",
    type => "auth",
    module => "pam_radius_auth.so",
    position => "after module pam_env.so",
    arguments => ["try_first_pass", "localifdown", "conf=/etc/sysconfig/raddb", "client_id=tacacs"],
    control => "sufficient",
  }
}

For some strange reason, it only applies system-auth, and ignores password-auth
completely. I cannot see anything in logs about it. If I change system-auth, it will repair the settings, but not for password-auth.

@hdeadman
Copy link

I was having a similar problem where I would reference service => password-auth and the change would go in system-auth. I got around it by specify the full path to the target file:

pam { 'Set cracklib limits in password-auth':
  ensure    => present,
  target    => '/etc/pam.d/password-auth',
  type      => 'password',
  module    => 'pam_cracklib.so',
  arguments => ['try_first_pass','retry=3','maxrepeat=3','minlen=10','dcredit=-1','ucredit=-1','ocredit=-1','lcredit=-1','difok=4'],
}

@cmouse
Copy link
Author

cmouse commented May 28, 2014

Did not help, unfortunately. password-auth file remains untouched. Also puppet agent --test --debug does not appear to show any information about pam being ran at all.

@raphink
Copy link
Member

raphink commented Jun 2, 2014

I can confirm this bug, although in my case, it behaves slightly differently:

$ puppet apply ticket_105.pp 
notice: /Stage[main]//Pam[Add radius authentication password-auth]/ensure: created
notice: Finished catalog run in 0.26 seconds

actually created (I'm using a fakeroot) /etc/pam.d/system-auth:

auth    sufficient  pam_radius_auth.so  try_first_pass  localifdown conf=/etc/sysconfig/raddb   client_id=tacacs

@raphink raphink added the bug label Jun 2, 2014
@raphink
Copy link
Member

raphink commented Jun 2, 2014

If I comment either of the resources, I get the exact same result, so it seems that the provider sees them as exactly equivalent.

@raphink
Copy link
Member

raphink commented Jun 2, 2014

Forcing the target parameter like @hdeadman suggested fixed it for me.

@raphink
Copy link
Member

raphink commented Jun 2, 2014

I've attached a commit to this ticket. Could you check if the attached branch fixes the bug for you please?

@cmouse
Copy link
Author

cmouse commented Jun 2, 2014

Interestingly enough, forcing the target did nothing on my system. I'll try the patch once travis is happy.

@raphink
Copy link
Member

raphink commented Jun 2, 2014

Rspec 3 was just released. The Travis errors come from this (RSpec::Expectations::Differ::Encoding errors), not from the patch.

@raphink
Copy link
Member

raphink commented Jun 2, 2014

My bad, it's actually my code that fails. Travis is running again.

@cmouse
Copy link
Author

cmouse commented Jun 2, 2014

This seems to work.

@raphink
Copy link
Member

raphink commented Jun 2, 2014

Fixed in 42ea31c

@raphink raphink closed this Jun 2, 2014
@raphink
Copy link
Member

raphink commented Jun 2, 2014

@domcleal Do you want to merge this into the 1.X branch?

@domcleal
Copy link
Contributor

domcleal commented Jun 2, 2014

@raphink er, you've already merged it to master, so it's a bit late. I guess I'll cherry pick to do a 1.1, else we'd have to revert, merge to a stable branch and then merge through to master again.

@raphink
Copy link
Member

raphink commented Jun 2, 2014

I was thinking of a cherry-pick. What would be your preferred way of doing it?

@domcleal
Copy link
Contributor

domcleal commented Jun 2, 2014

Cherry pick's fine, I'll do it nearer the time. The other way of doing it is to commit to the stable branch first and merge that into master, but I don't much care.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants