File: 032_pam_limits_EPERM_NOT_FATAL

package info (click to toggle)
pam 1.1.8-3.6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 11,800 kB
  • ctags: 2,930
  • sloc: ansic: 31,350; xml: 21,611; sh: 11,344; makefile: 1,563; perl: 893; yacc: 408; lex: 70; sed: 16
file content (22 lines) | stat: -rw-r--r-- 763 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
setrlimit will sometimes return EPERM for example if you try to increase the
number of open files too much.  This is not something we want to consider
fatal.  This also happens if you use non-root and try to decrease a limit.
Running PAM as non-root is not so great.

Authors: ?

Upstream status: submitted in <20070830171918.GB30563@dario.dodds.net>

Index: pam.deb/modules/pam_limits/pam_limits.c
===================================================================
--- pam.deb.orig/modules/pam_limits/pam_limits.c
+++ pam.deb/modules/pam_limits/pam_limits.c
@@ -735,6 +735,8 @@
 	if (res != 0)
 	  pam_syslog(pamh, LOG_ERR, "Could not set limit for '%s': %m",
 		     rlimit2str(i));
+	if (res == -1 && errno == EPERM)
+	    continue;
 	status |= res;
     }