summaryrefslogtreecommitdiff
path: root/modules/pam_limits/pam_limits.c
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2007-06-26 10:44:28 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2007-06-26 10:44:28 +0000
commiteca9894caa0f520e89ab608235996940e08e742e (patch)
tree5cfc2e6a7079a3ff23d99e3c9f8d6ffc674ce849 /modules/pam_limits/pam_limits.c
parentdd80f758c4772b8bebb2fc3335bf3457ab1eb7ca (diff)
Relevant BUGIDs:
Purpose of commit: bugfix Commit summary: --------------- 2007-06-26 Thorsten Kukuk <kukuk@thkukuk.de> * modules/pam_limits/pam_limits.c (process_limit): Check upper and lower limit of nice value, fix off-by-one in conversation to rlim_t. * xtests/Makefile.am: Add new pam_limits test case. * xtests/limits.conf: New, config file for test case. * xtests/pam_limits1.c: New, test case for RLIMIT_NICE. * xtests/pam_limits1.sh: Likewise. * xtests/pam_limits1.pamd: Likewise.
Diffstat (limited to 'modules/pam_limits/pam_limits.c')
-rw-r--r--modules/pam_limits/pam_limits.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/pam_limits/pam_limits.c b/modules/pam_limits/pam_limits.c
index bf6f09df..b7ed0adc 100644
--- a/modules/pam_limits/pam_limits.c
+++ b/modules/pam_limits/pam_limits.c
@@ -401,7 +401,9 @@ process_limit (const pam_handle_t *pamh, int source, const char *lim_type,
case RLIMIT_NICE:
if (int_value > 19)
int_value = 19;
- rlimit_value = 19 - int_value;
+ if (int_value < -20)
+ int_value = -20;
+ rlimit_value = 20 - int_value;
#endif
break;
}