unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Ricardo Wurmus <rekado@elephly.net>
Cc: "guix-devel@gnu.org" <guix-devel@gnu.org>
Subject: Re: [RFC]: Respect /etc/security/limits.conf
Date: Mon, 19 Oct 2015 16:58:09 +0200	[thread overview]
Message-ID: <87oafuzz0e.fsf@gnu.org> (raw)
In-Reply-To: <87mvvhgxp6.fsf@elephly.net> (Ricardo Wurmus's message of "Sat, 17 Oct 2015 20:24:37 +0200")

Ricardo Wurmus <rekado@elephly.net> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>
>>> Loading the module doesn’t yet do anything on GuixSD because we don’t
>>> generate ‘/etc/security/limits.conf’ (or ‘/etc/security/limits.d/’), but
>>> it should respect such file if it does exist.  (I have not yet tested
>>> this, but I will some time this week.)
>>>
>>> Does this look okay?
>>
>> As long as lack of /etc/security/limits.conf doesn’t create any problems
>> or annoying warnings, that’s fine!
>
> So, I did test this and found a couple of issues:
>
> * my patches need modification as ‘pam_limits.so’ looks for
>   ‘limits.conf’ in the output directory of the linux-pam package, not in
>   ‘/etc/security/’.  This can be changed by passing
>   “conf=/etc/security/limits.conf” as an argument for the pam-entry.

We don’t even have to add it to /etc then; we could do
“conf=/gnu/store/…-limits.conf”, which is preferable IMO (it’s like
avoiding a global variable.)

> * when ‘pam_limits.so’ is loaded by “login” and configured to look for
>   ‘/etc/security/limits.conf’, logins fail with “Error in service
>   module” when the file does not exist.

So I guess we could create an empty(?) limits.conf file by default?

> * changing the pam service for “login” is not enough as it only affects
>   console logins.  When a user logs in via slim (or switches user
>   accounts with ‘su’), limits are not respected.
>
> I’ll update my patches to address the first point.  For the second point
> we need to make sure to install ‘/etc/security/limits.conf’ (even if
> it’s just empty).  The linux-pam package provides ‘$out/etc/security/*’
> but nothing is deployed to ‘/etc’ when configuring the system.
>
> To address the third point we could enhance the pam-services for ‘slim’
> and ‘su’ in addition to ‘login’.

Sounds like a good plan.

I guess changing the default values of the PAM entries to include
pam_limits.so is reasonable.  A similar pattern occurs with elogind
though, as Andy wrote some time ago.

So, looking forward, there’s the question of whether we should provide a
more flexible way to extend ‘pam-service-type’.  For instance, there
could be a ‘limits-service’ that extends ‘pam-service-type’ such that
all the contributed PAM entries are augmented with ‘pam_limits.so’;
likewise, ‘elogind-service’ would add ‘pam_elogind.so.’

One way to do that would be to extend ‘pam-service-type’ with a
procedure instead of a ‘pam-entry’; that procedure would then be mapped
over all the contributed PAM entries.

Thoughts?

Ludo’.

      reply	other threads:[~2015-10-19 14:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-19 10:51 [RFC]: Respect /etc/security/limits.conf Ricardo Wurmus
2015-09-20 16:41 ` Ludovic Courtès
2015-10-12  5:23   ` Ricardo Wurmus
2015-10-12 17:13     ` Ludovic Courtès
2015-10-17 18:24       ` Ricardo Wurmus
2015-10-19 14:58         ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oafuzz0e.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=rekado@elephly.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).