diff options
author | Steve Langasek <vorlon@debian.org> | 2019-01-02 12:24:44 -0800 |
---|---|---|
committer | Steve Langasek <vorlon@debian.org> | 2019-01-02 12:27:24 -0800 |
commit | a6f4ab0bebc76acf85cc0244bd21c1036009c28c (patch) | |
tree | df0d6a57d2b91ab9038e8d7b0d62f28c2daa66db /debian/patches-applied/032_pam_limits_EPERM_NOT_FATAL | |
parent | 10b6243f4664747e815372070142d6c5853176da (diff) |
fix-up commit for grafting svn history onto git history
Diffstat (limited to 'debian/patches-applied/032_pam_limits_EPERM_NOT_FATAL')
-rw-r--r-- | debian/patches-applied/032_pam_limits_EPERM_NOT_FATAL | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/debian/patches-applied/032_pam_limits_EPERM_NOT_FATAL b/debian/patches-applied/032_pam_limits_EPERM_NOT_FATAL new file mode 100644 index 00000000..9baac8cf --- /dev/null +++ b/debian/patches-applied/032_pam_limits_EPERM_NOT_FATAL @@ -0,0 +1,33 @@ +setrlimit will sometimes return EPERM for example if youp 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: Linux-PAM/modules/pam_limits/pam_limits.c +=================================================================== +--- Linux-PAM/modules/pam_limits/pam_limits.c.orig ++++ Linux-PAM/modules/pam_limits/pam_limits.c +@@ -609,6 +609,7 @@ + } + + for (i=0, status=LIMITED_OK; i<RLIM_NLIMITS; i++) { ++ int retval; + if (!pl->limits[i].supported) { + /* skip it if its not known to the system */ + continue; +@@ -620,7 +621,10 @@ + } + if (pl->limits[i].limit.rlim_cur > pl->limits[i].limit.rlim_max) + pl->limits[i].limit.rlim_cur = pl->limits[i].limit.rlim_max; +- status |= setrlimit(i, &pl->limits[i].limit); ++ retval = setrlimit(i, &pl->limits[i].limit); ++ if (retval == -1 && errno==EPERM) ++ continue; ++ status |= retval; + } + + if (status) { |