Package: libpam-runtime Version: 0.79-1 Followup-For: Bug #326555
This is my backport of the version of the rtlimits patch now merged in the linux-pam CVS. Differences to previous patch are: - item name in limits.conf is "rt_prio" rather than "rt_priority" - nice value goes from -20 to 19, rather than 0 to 39. - do not define RLIMIT_FOO values, but rather get them from kernel headers (where available), and protect uses of them with #ifdef diff -ru pam-0.79/Linux-PAM/modules/pam_limits/pam_limits.c pam-0.79.rtlimit/Linux-PAM/modules/pam_limits/pam_limits.c --- pam-0.79/Linux-PAM/modules/pam_limits/pam_limits.c 2005-09-27 21:11:36.000000000 -0400 +++ pam-0.79.rtlimit/Linux-PAM/modules/pam_limits/pam_limits.c 2005-09-27 22:17:26.000000000 -0400 @@ -327,6 +327,14 @@ else if (strcmp(lim_item, "msgqueue") == 0) limit_item = RLIMIT_MSGQUEUE; #endif +#ifdef RLIMIT_RTPRIO + else if (strcmp(lim_item, "rt_prio") == 0) + limit_item = RLIMIT_RTPRIO; +#endif +#ifdef RLIMIT_NICE + else if (strcmp(lim_item, "nice") == 0) + limit_item = RLIMIT_NICE; +#endif else if (strcmp(lim_item, "maxlogins") == 0) { limit_item = LIMIT_LOGIN; pl->flag_numsyslogins = 0; @@ -399,6 +407,15 @@ #endif limit_value *= 1024; break; +#ifdef RLIMIT_NICE + case RLIMIT_NICE: + if (limit_value > 19) + limit_value = 19; + if (limit_value < 0) + limit_value = 0; + limit_value = 19 - limit_value; + break; +#endif } if ( (limit_item != LIMIT_LOGIN) diff -ru pam-0.79/Linux-PAM/modules/pam_limits/README pam-0.79.rtlimit/Linux-PAM/modules/pam_limits/README --- pam-0.79/Linux-PAM/modules/pam_limits/README 2005-01-10 05:09:51.000000000 -0500 +++ pam-0.79.rtlimit/Linux-PAM/modules/pam_limits/README 2005-09-27 22:15:01.000000000 -0400 @@ -42,6 +42,9 @@ - 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. (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 -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (500, 'unstable') Architecture: amd64 (x86_64) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.14-rc2 Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1) -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]