~ubuntu-branches/ubuntu/precise/nss-pam-ldapd/precise-security

« back to all changes in this revision

Viewing changes to nslcd/host.c

  • Committer: Package Import Robot
  • Author(s): Arthur de Jong
  • Date: 2011-09-04 21:00:00 UTC
  • mfrom: (14.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20110904210000-pe3u91iga88vtr16
Tags: 0.8.4
* Upload to unstable
* switch to using the member attribute by default instead of
  uniqueMember (backwards incompatible change)
* only return "x" as a password hash when the object has the shadowAccount
  objectClass and nsswitch.conf is configured to do shadow lookups using
  LDAP (this avoids some problems with pam_unix)
* fix problem with partial attribute name matches in DN (thanks Timothy
  White)
* fix a problem with objectSid mappings with recent versions of OpenLDAP
  (patch by Wesley Mason)
* set the socket timeout in a connection callback to avoid timeout
  issues during the SSL handshake (patch by Stefan Völkel)
* check for unknown variables in pam_authz_search
* only check password expiration when authenticating, only check account
  expiration when doing authorisation
* make buffer sizes consistent and grow all buffers holding string
  representations of numbers to be able to hold 64-bit numbers
* update AX_PTHREAD from autoconf-archive
* support querying DNS SRV records from a different domain than the current
  one (based on a patch by James M. Leddy)
* fix a problem with uninitialised memory while parsing the tls_ciphers
  option (closes: #638872) (but doesn't work yet due to #640384)
* implement bounds checking of numeric values read from LDAP (patch by
  Jakub Hrozek)
* correctly support large uid and gid values from LDAP (patch by Jakub
  Hrozek)
* improvements to the configure script (patch by Jakub Hrozek)
* switch to dh for debian/rules and bump debhelper compatibility to 8
* build Debian packages with multiarch support
* ship shlibs (but still no symbol files) for libnss-ldapd since that was
  the easiest way to support multiarch
* fix output in init script when restarting nslcd (closes: #637132)
* correctly handle leading and trailing spaces in preseeded debconf uri
  option (patch by Andreas B. Mundt) (closes: #637863)
* support spaces around database names in /etc/nsswitch.conf while
  configuring package (closes: #640185)
* updated Russian debconf translation by Yuri Kozlov (closes: #637751)
* updated French debconf translation by Christian Perrier (closes: #637756)
* added Slovak debconf translation by Slavko (closes: #637759)
* updated Danish debconf translation by Joe Hansen (closes :#637763)
* updated Brazilian Portuguese debconf translation by Denis Doria
* updated Portuguese debconf translation by Américo Monteiro
* updated Japanese debconf translation by Kenshi Muto (closes: #638195)
* updated Czech debconf translation by Miroslav Kure (closes: #639026)
* updated German debconf translation by Chris Leick (closes: #639107)
* updated Spanish debconf translation by Francisco Javier Cuadrado
  (closes: #639236)
* updated Dutch debconf translation by Arthur de Jong with help from Paul
  Gevers and Jeroen Schot

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
   Copyright (C) 1997-2005 Luke Howard
7
7
   Copyright (C) 2006 West Consulting
8
 
   Copyright (C) 2006, 2007, 2009, 2010 Arthur de Jong
 
8
   Copyright (C) 2006, 2007, 2009, 2010, 2011 Arthur de Jong
9
9
 
10
10
   This library is free software; you can redistribute it and/or
11
11
   modify it under the terms of the GNU Lesser General Public
78
78
                    attmap_host_cn,safename);
79
79
}
80
80
 
81
 
static int mkfilter_host_byaddr(const char *name,
 
81
static int mkfilter_host_byaddr(const char *addrname,
82
82
                                char *buffer,size_t buflen)
83
83
{
84
 
  char safename[64];
 
84
  char safeaddr[64];
85
85
  /* escape attribute */
86
 
  if (myldap_escape(name,safename,sizeof(safename)))
 
86
  if (myldap_escape(addrname,safeaddr,sizeof(safeaddr)))
87
87
    return -1;
88
88
  /* build filter */
89
89
  return mysnprintf(buffer,buflen,
90
90
                    "(&%s(%s=%s))",
91
91
                    host_filter,
92
 
                    attmap_host_ipHostNumber,safename);
 
92
                    attmap_host_ipHostNumber,safeaddr);
93
93
}
94
94
 
95
95
void host_init(void)
155
155
  host,byname,
156
156
  char name[256];
157
157
  char filter[1024];
158
 
  READ_STRING(fp,name);,
159
 
  log_log(LOG_DEBUG,"nslcd_host_byname(%s)",name);,
 
158
  READ_STRING(fp,name);
 
159
  log_setrequest("host=\"%s\"",name);,
160
160
  NSLCD_ACTION_HOST_BYNAME,
161
161
  mkfilter_host_byname(name,filter,sizeof(filter)),
162
162
  write_host(fp,entry)
167
167
  int af;
168
168
  char addr[64];
169
169
  int len=sizeof(addr);
170
 
  char name[64];
 
170
  char addrname[64];
171
171
  char filter[1024];
172
172
  READ_ADDRESS(fp,addr,len,af);
173
173
  /* translate the address to a string */
174
 
  if (inet_ntop(af,addr,name,sizeof(name))==NULL)
 
174
  if (inet_ntop(af,addr,addrname,sizeof(addrname))==NULL)
175
175
  {
176
176
    log_log(LOG_WARNING,"unable to convert address to string");
177
177
    return -1;
178
 
  },
179
 
  log_log(LOG_DEBUG,"nslcd_host_byaddr(%s)",name);,
 
178
  }
 
179
  log_setrequest("host=%s",addrname);,
180
180
  NSLCD_ACTION_HOST_BYADDR,
181
 
  mkfilter_host_byaddr(name,filter,sizeof(filter)),
 
181
  mkfilter_host_byaddr(addrname,filter,sizeof(filter)),
182
182
  write_host(fp,entry)
183
183
)
184
184
 
185
185
NSLCD_HANDLE(
186
186
  host,all,
187
187
  const char *filter;
188
 
  /* no parameters to read */,
189
 
  log_log(LOG_DEBUG,"nslcd_host_all()");,
 
188
  log_setrequest("host(all)");,
190
189
  NSLCD_ACTION_HOST_ALL,
191
190
  (filter=host_filter,0),
192
191
  write_host(fp,entry)