~ubuntu-branches/ubuntu/lucid/libnss-ldap/lucid

« back to all changes in this revision

Viewing changes to debian/patches/authpriv_log_c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2009-11-06 01:24:42 UTC
  • mfrom: (1.1.8 upstream) (11.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091106012442-5nynms8vz39j8o6i
Tags: 264-2ubuntu1
* Merge from debian testing, remaining changes:
  + debian/control: update Maintainer field now that in main
  + debian/control: Depends on ldap-auth-config
  + debian/control: Removed Depends on po-debconf and debconf (debconf
    handled by ldap-auth-config now)
  + removed the following files:
    - debian/config
    - debian/libnss-ldap.postinst
    - debian/libnss-ldap.postrm
    - debian/patches/00debian_conf.patch
    - debian/po
    - debian/templates
  + debian/LDAP-Permissions.txt: use /etc/ldap.conf
  + debian/README.Debian: use /etc/ldap.conf
  + debian/rules: don't use --with-ldap-conf-file and --with-ldap-secret-file
  + debian/libnss-ldap.install: removed usr/share/libnss-ldap/ldap.conf
  + debian/libnss-ldap.dirs: removed usr/share/libnss-ldap
  + debian/control: move nscd to Suggests
  + debian/patches/series, debian/patches/00fix-ethers-truncation.patch:
    Fix lookups for hostname by MAC address (http://bugzilla.padl.com/show_bug.cgi?id=388) (LP: #315241)
* Remaining changes from debian unstable for LP: #155947
  + added debian/nssldap-update-ignoreusers which update
    nss_initgroups_ignoreusers in /etc/ldap.conf based on
    nss_initgroups_minimum_uid
  + add manpage for nssldap-update-ignoreusers
  + debian/libnss-ldap.install: added usr/sbin/nssldap-update-ignoreusers
    and usr/share/man/man8/nssldap-update-ignoreusers.8
  + added debian/libnss-ldap.init to call nssldap-update-ignoreusers on
    shutdown
  + debian/rules: install initscript
  + debian/libnss-ldap.dirs: added var/lib/libnss-ldap
  + debian/patches/01_minimum_uid.patch: update ldap.conf and manpage for
    nss_initgroups_ignoreusers and nss_initgroups_minimum_uid updates

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# * Modified syslog() calls to use LOG_AUTHPRIV facility, Closes: #310421
 
2
--- libnss-ldap-255.orig/ldap-nss.c
 
3
+++ libnss-ldap-255/ldap-nss.c
 
4
@@ -697,7 +753,7 @@
 
5
 # else
 
6
       sd = __session.ls_conn->ld_sb.sb_sd;
 
7
 # endif /* LDAP_OPT_DESC */
 
8
-      syslog (LOG_INFO, "nss_ldap: closing connection %p fd %d",
 
9
+      syslog (LOG_AUTHPRIV | LOG_INFO, "nss_ldap: closing connection %p fd %d",
 
10
              __session.ls_conn, sd);
 
11
 #endif /* DEBUG */
 
12
 
 
13
@@ -973,7 +1035,7 @@
 
14
   closeSd = do_get_our_socket (&sd);
 
15
 
 
16
 #if defined(DEBUG) || defined(DEBUG_SOCKETS)
 
17
-  syslog (LOG_INFO, "nss_ldap: %sclosing connection (no unbind) %p fd %d",
 
18
+  syslog (LOG_AUTHPRIV | LOG_INFO, "nss_ldap: %sclosing connection (no unbind) %p fd %d",
 
19
          closeSd ? "" : "not ", __session.ls_conn, sd);
 
20
 #endif /* DEBUG */
 
21
 
 
22
@@ -1128,11 +1190,11 @@
 
23
 
 
24
 #ifdef DEBUG
 
25
 #ifdef HAVE_PTHREAD_ATFORK
 
26
-  syslog (LOG_DEBUG,
 
27
+  syslog (LOG_AUTHPRIV | LOG_DEBUG,
 
28
          "nss_ldap: __session.ls_state=%d, __session.ls_conn=%p, __euid=%i, euid=%i",
 
29
          __session.ls_state, __session.ls_conn, __euid, euid);
 
30
 #elif defined(HAVE_LIBC_LOCK_H) || defined(HAVE_BITS_LIBC_LOCK_H)
 
31
-  syslog (LOG_DEBUG,
 
32
+  syslog (LOG_AUTHPRIV | LOG_DEBUG,
 
33
          "nss_ldap: libpthreads=%s, __session.ls_state=%d, __session.ls_conn=%p, __pid=%i, pid=%i, __euid=%i, euid=%i",
 
34
          (__pthread_once == NULL ? "FALSE" : "TRUE"),
 
35
          __session.ls_state,
 
36
@@ -1140,7 +1202,7 @@
 
37
          (__pthread_once == NULL ? __pid : -1),
 
38
          (__pthread_once == NULL ? pid : -1), __euid, euid);
 
39
 #else
 
40
-  syslog (LOG_DEBUG,
 
41
+  syslog (LOG_AUTHPRIV | LOG_DEBUG,
 
42
          "nss_ldap: __session.ls_state=%d, __session.ls_conn=%p, __pid=%i, pid=%i, __euid=%i, euid=%i",
 
43
          __session.ls_state, __session.ls_conn, __pid, pid, __euid, euid);
 
44
 #endif
 
45
@@ -1626,7 +1688,7 @@
 
46
   if (rc != LDAP_SUCCESS)
 
47
     {
 
48
       /* log actual LDAP error code */
 
49
-      syslog (LOG_INFO,
 
50
+      syslog (LOG_AUTHPRIV | LOG_INFO,
 
51
              "nss_ldap: failed to bind to LDAP server %s: %s",
 
52
              cfg->ldc_uris[__session.ls_current_uri],
 
53
              ldap_err2string (rc));
 
54
@@ -1784,6 +1846,9 @@
 
55
 #else
 
56
          rc = ld->ld_errno;
 
57
 #endif /* LDAP_OPT_ERROR_NUMBER */
 
58
+         /* Notify if we failed. */
 
59
+         syslog (LOG_AUTHPRIV | LOG_ERR, "nss_ldap: could not connect to any LDAP server as %s - %s",
 
60
+                         dn, ldap_err2string (rc));
 
61
          debug ("<== do_bind");
 
62
 
 
63
          return rc;
 
64
@@ -2398,7 +2463,7 @@
 
65
 #else
 
66
          rc = __session.ls_conn->ld_errno;
 
67
 #endif /* LDAP_OPT_ERROR_NUMBER */
 
68
-         syslog (LOG_ERR, "nss_ldap: could not get LDAP result - %s",
 
69
+         syslog (LOG_AUTHPRIV | LOG_ERR, "nss_ldap: could not get LDAP result - %s",
 
70
                  ldap_err2string (rc));
 
71
          stat = NSS_UNAVAIL;
 
72
          break;
 
73
@@ -2428,7 +2493,7 @@
 
74
                {
 
75
                  stat = NSS_UNAVAIL;
 
76
                  ldap_abandon (__session.ls_conn, ctx->ec_msgid);
 
77
-                 syslog (LOG_ERR,
 
78
+                 syslog (LOG_AUTHPRIV | LOG_ERR,
 
79
                          "nss_ldap: could not get LDAP result - %s",
 
80
                          ldap_err2string (rc));
 
81
                }
 
82
@@ -2502,15 +2567,15 @@
 
83
          else if (backoff < __session.ls_config->ldc_reconnect_maxsleeptime)
 
84
            backoff *= 2;
 
85
 
 
86
-         syslog (LOG_INFO,
 
87
+         syslog (LOG_AUTHPRIV | LOG_INFO,
 
88
                  "nss_ldap: reconnecting to LDAP server (sleeping %d seconds)...",
 
89
                  backoff);
 
90
          (void) sleep (backoff);
 
91
        }
 
92
-      else if (tries > 1)
 
93
+      else if (tries > 0)
 
94
        {
 
95
          /* Don't sleep, reconnect immediately. */
 
96
-         syslog (LOG_INFO, "nss_ldap: reconnecting to LDAP server...");
 
97
+         syslog (LOG_AUTHPRIV | LOG_INFO, "nss_ldap: reconnecting to LDAP server...");
 
98
        }
 
99
 
 
100
       /* For each "try", attempt to connect to all specified URIs */
 
101
@@ -2561,11 +2626,11 @@
 
102
   switch (stat)
 
103
     {
 
104
     case NSS_UNAVAIL:
 
105
-      syslog (LOG_ERR, "nss_ldap: could not search LDAP server - %s",
 
106
+      syslog (LOG_AUTHPRIV | LOG_ERR, "nss_ldap: could not search LDAP server - %s",
 
107
              ldap_err2string (rc));
 
108
       break;
 
109
     case NSS_TRYAGAIN:
 
110
-      syslog (LOG_ERR,
 
111
+      syslog (LOG_AUTHPRIV | LOG_ERR,
 
112
              "nss_ldap: could not %s %sconnect to LDAP server - %s",
 
113
              hard ? "hard" : "soft", tries ? "re" : "",
 
114
              ldap_err2string (rc));
 
115
@@ -2580,11 +2645,11 @@
 
116
            uri = "(null)";
 
117
 
 
118
          if (tries)
 
119
-           syslog (LOG_INFO,
 
120
+           syslog (LOG_AUTHPRIV | LOG_INFO,
 
121
              "nss_ldap: reconnected to LDAP server %s after %d attempt%s",
 
122
              uri, tries, (tries == 1) ? "" : "s");
 
123
          else
 
124
-           syslog (LOG_INFO, "nss_ldap: reconnected to LDAP server %s", uri);
 
125
+           syslog (LOG_AUTHPRIV | LOG_INFO, "nss_ldap: reconnected to LDAP server %s", uri);
 
126
        }
 
127
       time (&__session.ls_timestamp);
 
128
       break;