summaryrefslogtreecommitdiff
path: root/modules/pam_limits
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pam_limits')
-rw-r--r--modules/pam_limits/README4
-rw-r--r--modules/pam_limits/limits.skel2
-rw-r--r--modules/pam_limits/pam_limits.c8
3 files changed, 14 insertions, 0 deletions
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
#
#<domain> <type> <item> <value>
#
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
@@ -306,6 +306,14 @@ static void process_limit(int source, const char *lim_type,
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;
pl->flag_numsyslogins = 0;