| 1 |
From: Sam Hartman <[email protected]> |
| 2 |
Date: Mon, 11 Sep 2023 14:00:42 -0600 |
| 3 |
Subject: _pam_limits_EPERM_NOT_FATAL |
| 4 |
|
| 5 |
setrlimit will sometimes return EPERM for example if you try to increase the |
| 6 |
number of open files too much. This is not something we want to consider |
| 7 |
fatal. This also happens if you use non-root and try to decrease a limit. |
| 8 |
Running PAM as non-root is not so great. |
| 9 |
|
| 10 |
Authors: ? |
| 11 |
|
| 12 |
Upstream status: submitted in <[email protected]> |
| 13 |
--- |
| 14 |
modules/pam_limits/pam_limits.c | 2 ++ |
| 15 |
1 file changed, 2 insertions(+) |
| 16 |
|
| 17 |
diff --git a/modules/pam_limits/pam_limits.c b/modules/pam_limits/pam_limits.c |
| 18 |
index 5ec30ca..9f11927 100644 |
| 19 |
--- a/modules/pam_limits/pam_limits.c |
| 20 |
+++ b/modules/pam_limits/pam_limits.c |
| 21 |
@@ -1264,6 +1264,8 @@ static int setup_limits(pam_handle_t *pamh, |
| 22 |
if (res != 0) |
| 23 |
pam_syslog(pamh, LOG_ERR, "Could not set limit for '%s': %m", |
| 24 |
rlimit2str(i)); |
| 25 |
+ if (res == -1 && errno == EPERM) |
| 26 |
+ continue; |
| 27 |
status |= res; |
| 28 |
} |
| 29 |
|