~ubuntu-branches/ubuntu/karmic/pam/karmic

« back to all changes in this revision

Viewing changes to debian/patches-applied/040_pam_limits_log_failure

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2009-08-26 00:40:14 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090826004014-qsd46mostuyljeqp
Tags: 1.1.0-1ubuntu1
* Merge from Debian, remaining changes:
  - debian/libpam-modules.postinst: Add PATH to /etc/environment if it's not
    present there or in /etc/security/pam_env.conf. (should send to Debian).
  - debian/libpam0g.postinst: only ask questions during update-manager when
    there are non-default services running.
  - debian/patches-applied/series: Ubuntu patches are as below ...
  - debian/patches-applied/ubuntu-no-error-if-missingok: add a new, magic
    module option 'missingok' which will suppress logging of errors by
    libpam if the module is not found.
  - debian/patches-applied/ubuntu-regression_fix_securetty: prompt for
    password on bad username.
  - debian/patches-applied/ubuntu-rlimit_nice_correction: Explicitly
    initialise RLIMIT_NICE rather than relying on the kernel limits.
  - Change Vcs-Bzr to point at the Ubuntu branch.
  - debian/local/common-password, debian/pam-configs/unix: switch from
    "md5" to "sha512" as password crypt default.
  - Make libpam-modules depend on base-files (>= 5.0.0ubuntu6), to ensure
    run-parts does the right thing in /etc/update-motd.d.
  - debian/patches-applied/pam_motd-legal-notice: display the contents of
    /etc/legal once, then set a flag in the user's homedir to prevent showing
    it again.
  - debian/local/common-{auth,account,password}.md5sums: include the
    Ubuntu-specific intrepid,jaunty md5sums for use during the
    common-session-noninteractive upgrade.
* Dropped changes, superseded upstream:
  - debian/patches-applied/ubuntu-fix_standard_types: Use standard u_int8_t
    type rather than __u8.
  - debian/patches-applied/ubuntu-user_defined_environment: Look at
    ~/.pam_environment too, with the same format as
    /etc/security/pam_env.conf.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
Upstream status: submitted in <20070830171918.GB30563@dario.dodds.net>
9
9
 
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
14
 
@@ -664,6 +664,19 @@
 
12
--- pam.deb.orig/modules/pam_limits/pam_limits.c
 
13
+++ pam.deb/modules/pam_limits/pam_limits.c
 
14
@@ -732,9 +732,19 @@
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);
 
18
-       if (res != 0)
 
19
-         pam_syslog(pamh, LOG_ERR, "Could not set limit for '%s': %m",
 
20
-                    rlimit2str(i));
 
21
+       if (res != 0 && (i != RLIMIT_NOFILE
19
22
+                           || pl->limits[i].limit.rlim_cur != RLIM_INFINITY))
20
23
+       {
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;
30
33
+       }
31
 
         if (retval == -1 && errno==EPERM)
 
34
        if (res == -1 && errno == EPERM)
32
35
            continue;
33
 
        status |= retval;
 
36
        status |= res;