From 2ff2e4efe031c6ff3d4f2bd54121e304fea3d024 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Fri, 7 Jan 2005 12:16:01 +0000 Subject: Relevant BUGIDs: Red Hat bz 131190 Purpose of commit: new feature Commit summary: --------------- Support new limits of Linux kernel 2.6 --- modules/pam_limits/README | 3 +++ modules/pam_limits/limits.skel | 2 ++ modules/pam_limits/pam_limits.c | 8 ++++++++ 3 files changed, 13 insertions(+) (limited to 'modules') diff --git a/modules/pam_limits/README b/modules/pam_limits/README index 023b9575..32afb197 100644 --- a/modules/pam_limits/README +++ b/modules/pam_limits/README @@ -39,6 +39,9 @@ Where: - maxsyslogins - max number of logins on the system - priority - lower the priority by given value (value can be -ve) - locks - max locked files (Linux 2.4 and higher) + - 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) 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 ccb4e103..9ba31b19 100644 --- a/modules/pam_limits/limits.skel +++ b/modules/pam_limits/limits.skel @@ -30,6 +30,8 @@ # - maxlogins - max number of logins for this user # - priority - the priority to run user process with # - 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) # # # diff --git a/modules/pam_limits/pam_limits.c b/modules/pam_limits/pam_limits.c index 2e9314a8..9ba19843 100644 --- a/modules/pam_limits/pam_limits.c +++ b/modules/pam_limits/pam_limits.c @@ -292,6 +292,14 @@ static void process_limit(int source, const char *lim_type, #ifdef RLIMIT_LOCKS else if (strcmp(lim_item, "locks") == 0) limit_item = RLIMIT_LOCKS; +#endif +#ifdef RLIMIT_SIGPENDING + else if (strcmp(lim_item, "sigpending") == 0) + limit_item = RLIMIT_SIGPENDING; +#endif +#ifdef RLIMIT_MSGQUEUE + else if (strcmp(lim_item, "msgqueue") == 0) + limit_item = RLIMIT_MSGQUEUE; #endif else if (strcmp(lim_item, "maxlogins") == 0) { limit_item = LIMIT_LOGIN; -- cgit v1.2.3