8
8
Upstream status: submitted in <20070830171918.GB30563@dario.dodds.net>
10
Index: debian-pkg-pam/modules/pam_limits/pam_limits.c
10
Index: pam.deb/modules/pam_limits/pam_limits.c
11
11
===================================================================
12
--- debian-pkg-pam.orig/modules/pam_limits/pam_limits.c 2009-04-17 12:47:06.000000000 -0700
13
+++ debian-pkg-pam/modules/pam_limits/pam_limits.c 2009-04-17 12:47:13.000000000 -0700
12
--- pam.deb.orig/modules/pam_limits/pam_limits.c
13
+++ pam.deb/modules/pam_limits/pam_limits.c
15
15
if (pl->limits[i].limit.rlim_cur > pl->limits[i].limit.rlim_max)
16
16
pl->limits[i].limit.rlim_cur = pl->limits[i].limit.rlim_max;
17
retval = setrlimit(i, &pl->limits[i].limit);
18
+ if (retval != 0 && (i != RLIMIT_NOFILE
17
res = setrlimit(i, &pl->limits[i].limit);
19
- pam_syslog(pamh, LOG_ERR, "Could not set limit for '%s': %m",
21
+ if (res != 0 && (i != RLIMIT_NOFILE
19
22
+ || pl->limits[i].limit.rlim_cur != RLIM_INFINITY))
21
24
+ int save_errno = errno;
22
25
+ pam_syslog(pamh, LOG_DEBUG,
23
+ "setrlimit limit #%d to soft=%d, hard=%d failed:"
24
+ " %m; uid=%lu,euid=%lu", i,
26
+ "Could not set limit for '%s' to soft=%d, hard=%d:"
27
+ " %m; uid=%lu,euid=%lu", rlimit2str(i),
25
28
+ pl->limits[i].limit.rlim_cur,
26
29
+ pl->limits[i].limit.rlim_max,
27
30
+ (unsigned long) getuid(),
28
31
+ (unsigned long) geteuid());
29
32
+ errno = save_errno;
31
if (retval == -1 && errno==EPERM)
34
if (res == -1 && errno == EPERM)