mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vegard Lima <Vegard.Lima@hia.no>
To: linux-kernel@vger.kernel.org
Subject: pam and nice-rt-prio-rlimits
Date: Mon, 14 Mar 2005 10:14:17 +0100	[thread overview]
Message-ID: <1110791657.1807.11.camel@pingvin.krs.hia.no> (raw)

Hello,

in the long thread on "[request for inclusion] Realtime LSM" there
doesn't appear to be too many people who has actually tested the
nice-and-rt-prio-rlimits.patch. Well, it works for me...

However, the patch to pam_limits posted here:
  http://lkml.org/lkml/2005/1/14/174
is a little bit aggressive on the semi-colon side.

Tested patch (and pam.src.rpm for fedora c3) can be found here
  http://home.hia.no/~vegardl/rlimit/
and below

--- Linux-PAM-0.77/modules/pam_limits/pam_limits.c.rtprio	2005-03-13 16:15:07.000000000 +0100
+++ Linux-PAM-0.77/modules/pam_limits/pam_limits.c	2005-03-13 16:27:54.000000000 +0100
@@ -39,6 +39,11 @@
 #include <grp.h>
 #include <pwd.h>
 
+/* Hack to test new rlimit values */
+#define RLIMIT_NICE	13
+#define RLIMIT_RTPRIO	14
+#define RLIM_NLIMITS	15
+
 /* Module defines */
 #define LINE_LENGTH 1024
 
@@ -293,6 +298,10 @@
     else if (strcmp(lim_item, "locks") == 0)
 	limit_item = RLIMIT_LOCKS;
 #endif
+    else if (strcmp(lim_item, "rt_priority") == 0)
+	limit_item = RLIMIT_RTPRIO;
+    else if (strcmp(lim_item, "nice") == 0)
+	limit_item = RLIMIT_NICE;
     else if (strcmp(lim_item, "maxlogins") == 0) {
 	limit_item = LIMIT_LOGIN;
 	pl->flag_numsyslogins = 0;
@@ -360,6 +369,18 @@
         case RLIMIT_AS:
             limit_value *= 1024;
             break;
+        case RLIMIT_NICE:
+            if (limit_value > 39)
+		limit_value = 39;
+	    if (limit_value < 0)
+		limit_value = 0;
+            break;
+        case RLIMIT_RTPRIO:
+            if (limit_value > 99)
+		limit_value = 99;
+	    if (limit_value < 0)
+		limit_value = 0;
+            break;
     }
 
     if ( (limit_item != LIMIT_LOGIN)



Thanks,
-- 
Vegard Lima



             reply	other threads:[~2005-03-14  9:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-14  9:14 Vegard Lima [this message]
2005-03-14 21:43 ` Matt Mackall
2005-03-14 23:13   ` Vegard Lima

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

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

  git send-email \
    --in-reply-to=1110791657.1807.11.camel@pingvin.krs.hia.no \
    --to=vegard.lima@hia.no \
    --cc=linux-kernel@vger.kernel.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®