~ubuntu-branches/ubuntu/trusty/nss-pam-ldapd/trusty-proposed

« back to all changes in this revision

Viewing changes to nslcd/log.c

  • Committer: Bazaar Package Importer
  • Author(s): Arthur de Jong
  • Date: 2011-03-10 22:00:00 UTC
  • mto: (14.1.5 experimental) (16.1.6)
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: james.westby@ubuntu.com-20110310220000-tyhxifj2ovpxnqqm
Tags: 0.8.1
* SECURITY FIX: the PAM module will allow authentication for users that do
                not exist in LDAP, this allows login to local users with an
                incorrect password (CVE-2011-0438)
                the explotability of the problem depends on the details of
                the PAM stack and the use of the minimum_uid PAM option
* add FreeBSD support, partially imported from the FreeBSD port (thanks to
  Jacques Vidrine, Artem Kazakov and Alexander V. Chernikov)
* document how to replace name pam_check_service_attr and
  pam_check_host_attr options in PADL's pam_ldap with with pam_authz_search
  in nss-pam-ldapd (closes: #610925)
* implement a fqdn variable that can be used in pam_authz_search filters
* create the directory to hold the socket and pidfile on startup
* implement host, network and netgroup support in pynslcd

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
   log.c - logging funtions
3
3
 
4
 
   Copyright (C) 2002, 2003, 2008, 2010 Arthur de Jong
 
4
   Copyright (C) 2002, 2003, 2008, 2010, 2011 Arthur de Jong
5
5
 
6
6
   This library is free software; you can redistribute it and/or
7
7
   modify it under the terms of the GNU Lesser General Public
134
134
}
135
135
 
136
136
 
 
137
/* indicate that we should clear any session identifiers set by
 
138
   log_newsession */
 
139
void log_clearsession(void)
 
140
{
 
141
  /* set the session id to empty */
 
142
  if (sessionid!=NULL)
 
143
    sessionid[0]='\0';
 
144
  /* set the request id to empty */
 
145
  if (requestid!=NULL)
 
146
    requestid[0]='\0';
 
147
}
 
148
 
137
149
/* indicate that a session id should be included in the output
138
150
   and set it to a new value */
139
151
void log_newsession(void)
207
219
    {
208
220
      if ((requestid!=NULL)&&(requestid[0]!='\0'))
209
221
        fprintf(stderr,"%s: [%s] <%s> %s%s\n",PACKAGE,sessionid,requestid,pri==LOG_DEBUG?"DEBUG: ":"",buffer);
210
 
      else if (sessionid)
 
222
      else if ((sessionid!=NULL)&&(sessionid[0]!='\0'))
211
223
        fprintf(stderr,"%s: [%s] %s%s\n",PACKAGE,sessionid,pri==LOG_DEBUG?"DEBUG: ":"",buffer);
212
224
      else
213
225
        fprintf(stderr,"%s: %s%s\n",PACKAGE,pri==LOG_DEBUG?"DEBUG: ":"",buffer);
223
235
        {
224
236
          if ((requestid!=NULL)&&(requestid[0]!='\0'))
225
237
            syslog(pri,"[%s] <%s> %s",sessionid,requestid,buffer);
226
 
          else if (sessionid)
 
238
          else if ((sessionid!=NULL)&&(sessionid[0]!='\0'))
227
239
            syslog(pri,"[%s] %s",sessionid,buffer);
228
240
          else
229
241
            syslog(pri,"%s",buffer);
232
244
        {
233
245
          if ((requestid!=NULL)&&(requestid[0]!='\0'))
234
246
            fprintf(lst->fp,"%s: [%s] <%s> %s\n",sessionid,requestid,PACKAGE,buffer);
235
 
          else if (sessionid)
 
247
          else if ((sessionid!=NULL)&&(sessionid[0]!='\0'))
236
248
            fprintf(lst->fp,"%s: [%s] %s\n",sessionid,PACKAGE,buffer);
237
249
          else
238
250
            fprintf(lst->fp,"%s: %s\n",PACKAGE,buffer);