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

« back to all changes in this revision

Viewing changes to nslcd/network.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
76
76
                    attmap_network_cn,safename);
77
77
}
78
78
 
79
 
static int mkfilter_network_byaddr(const char *name,
 
79
static int mkfilter_network_byaddr(const char *addrname,
80
80
                                   char *buffer,size_t buflen)
81
81
{
82
 
  char safename[64];
 
82
  char safeaddr[64];
83
83
  /* escape attribute */
84
 
  if (myldap_escape(name,safename,sizeof(safename)))
 
84
  if (myldap_escape(addrname,safeaddr,sizeof(safeaddr)))
85
85
    return -1;
86
86
  /* build filter */
87
87
  return mysnprintf(buffer,buflen,
88
88
                    "(&%s(%s=%s))",
89
89
                    network_filter,
90
 
                    attmap_network_ipNetworkNumber,safename);
 
90
                    attmap_network_ipNetworkNumber,safeaddr);
91
91
}
92
92
 
93
93
void network_init(void)
153
153
  network,byname,
154
154
  char name[256];
155
155
  char filter[1024];
156
 
  READ_STRING(fp,name);,
157
 
  log_log(LOG_DEBUG,"nslcd_network_byname(%s)",name);,
 
156
  READ_STRING(fp,name);
 
157
  log_setrequest("network=\"%s\"",name);,
158
158
  NSLCD_ACTION_NETWORK_BYNAME,
159
159
  mkfilter_network_byname(name,filter,sizeof(filter)),
160
160
  write_network(fp,entry)
165
165
  int af;
166
166
  char addr[64];
167
167
  int len=sizeof(addr);
168
 
  char name[64];
 
168
  char addrname[64];
169
169
  char filter[1024];
170
170
  READ_ADDRESS(fp,addr,len,af);
171
171
  /* translate the address to a string */
172
 
  if (inet_ntop(af,addr,name,sizeof(name))==NULL)
 
172
  if (inet_ntop(af,addr,addrname,sizeof(addrname))==NULL)
173
173
  {
174
174
    log_log(LOG_WARNING,"unable to convert address to string");
175
175
    return -1;
176
 
  },
177
 
  log_log(LOG_DEBUG,"nslcd_network_byaddr(%s)",name);,
 
176
  }
 
177
  log_setrequest("network=%s",addrname);,
178
178
  NSLCD_ACTION_NETWORK_BYADDR,
179
 
  mkfilter_network_byaddr(name,filter,sizeof(filter)),
 
179
  mkfilter_network_byaddr(addrname,filter,sizeof(filter)),
180
180
  write_network(fp,entry)
181
181
)
182
182
 
183
183
NSLCD_HANDLE(
184
184
  network,all,
185
185
  const char *filter;
186
 
  /* no parameters to read */,
187
 
  log_log(LOG_DEBUG,"nslcd_network_all()");,
 
186
  log_setrequest("network(all)");,
188
187
  NSLCD_ACTION_NETWORK_ALL,
189
188
  (filter=network_filter,0),
190
189
  write_network(fp,entry)