As far as I can see, pam_limits and pam_groups both work as designed.
pam_limits allows you to change the limits for a user based on their
*group membership*.  pam_groups does *not* change the group membership
of a user, it only temporarily grants additional group privileges to the
running process.  pam_limits will always check the system group
information, which is actually what it should do.

So ultimately, what you're asking for here is not supported and that's
not going to change.  However, there are some things you mention here in
your report which don't make sense to me.  These could point to bugs in
packages, but probably just indicate bugs in your setup.

> I also strace'd the login process to see when things are being loaded. pam 
> looks
> at limits.conf at around line 300, while it looks at group.conf at around 
> 7000.
> This is consistent with the problem, but brings us no closer to finding a
> solution.

This probably only indicates when the files are parsed, not when they're
applied.  The pam_groups rules are applied in the auth stack, which
*must* be done before applying the rules for the session stack (which is
when pam_limits runs).  The relevant syscalls would actually be
setrlimit() vs. setgroups().

> In addition, adding an LDAP user to /etc/security/limits.conf
> directly does not work either.

There is no reason this should be the case on a correctly configured
system.  You may want to double-check this for sanity's sake  (though I
understand you're not likely to want to add the users individually to
limits.conf).

> A workaround would be to have a script that will just add all ldap users
> to local groups (once a day, perhaps?). This is not a good option, but
> it may be our only option.

The other conceivable workaround would be to have the group membership
information included as part of the LDAP data and propagated to your
system via nss_ldap; this would prevent the need for any per-user
configuration in either group.conf or /etc/group.  This of course
assumes a degree of control over the LDAP data which may not apply here.

** Changed in: pam (Ubuntu)
       Status: New => Won't Fix

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/897940

Title:
  pam_limits not working with pam_groups

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pam/+bug/897940/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to