From af62aef12b42f38c40ce68a7ef1d1933576918e0 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Wed, 22 Jun 2005 08:11:02 +0000 Subject: Relevant BUGIDs: Purpose of commit: new feature Commit summary: --------------- pam_limits: Support new limits in linux 2.6.12 --- modules/pam_limits/README | 4 ++++ modules/pam_limits/limits.skel | 2 ++ modules/pam_limits/pam_limits.c | 8 ++++++++ 3 files changed, 14 insertions(+) (limited to 'modules') diff --git a/modules/pam_limits/README b/modules/pam_limits/README index ac37afe1..ab2b6545 100644 --- a/modules/pam_limits/README +++ b/modules/pam_limits/README @@ -42,6 +42,10 @@ Where: - sigpending - max number of pending signals (Linux 2.6 and higher) - msgqueue - max memory used by POSIX message queues (bytes) (Linux 2.6 and higher) + - nice - max nice priority allowed to raise to. Nice levels 19..-20 + correspond to 0..39 values of this limit (Linux 2.6.12 and higher) + - rtprio - max realtime priority allowed for non-priviledged + processes (Linux 2.6.12 and higher) Note, if you specify a type of '-' but neglect to supply the item and value fields then the module will never enforce any limits on the diff --git a/modules/pam_limits/limits.skel b/modules/pam_limits/limits.skel index d805e0ce..c52778b1 100644 --- a/modules/pam_limits/limits.skel +++ b/modules/pam_limits/limits.skel @@ -33,6 +33,8 @@ # - locks - max number of file locks the user can hold # - sigpending - max number of pending signals # - msgqueue - max memory used by POSIX message queues (bytes) +# - nice - max nice priority allowed to raise to +# - rtprio - max realtime priority # # # diff --git a/modules/pam_limits/pam_limits.c b/modules/pam_limits/pam_limits.c index eec3917a..5909cb28 100644 --- a/modules/pam_limits/pam_limits.c +++ b/modules/pam_limits/pam_limits.c @@ -305,6 +305,14 @@ static void process_limit(int source, const char *lim_type, #ifdef RLIMIT_MSGQUEUE else if (strcmp(lim_item, "msgqueue") == 0) limit_item = RLIMIT_MSGQUEUE; +#endif +#ifdef RLIMIT_NICE + else if (strcmp(lim_item, "nice") == 0) + limit_item = RLIMIT_NICE; +#endif +#ifdef RLIMIT_RTPRIO + else if (strcmp(lim_item, "rtprio") == 0) + limit_item = RLIMIT_RTPRIO; #endif else if (strcmp(lim_item, "maxlogins") == 0) { limit_item = LIMIT_LOGIN; -- cgit v1.2.3