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

« back to all changes in this revision

Viewing changes to debian/libpam-ldapd.postinst

  • 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:
10
10
 
11
11
pam-auth-update --package
12
12
 
 
13
# check whether the name is configure to do lookups through
 
14
# LDAP
 
15
# Note: this function is in libnss-ldapd.postinst, libnss-ldapd.postrm
 
16
#       and libpam-ldapd.postinst
 
17
nss_is_enabled()
 
18
{
 
19
  name="$1"
 
20
  grep -q '^[[:space:]]*'$name'[[:space:]]*:.*ldap.*' /etc/nsswitch.conf
 
21
}
 
22
 
13
23
# check to see if name is configured to do lookups through
14
24
# LDAP and enable if not
15
 
# Note: this function is in both libnss-ldapd.postinst and libpam-ldapd.postinst
 
25
# Note: this function is in libnss-ldapd.postinst and libpam-ldapd.postinst
16
26
nss_enable()
17
27
{
18
28
  name="$1"
19
 
  if ! grep -q '^'$name':.*ldap.*' /etc/nsswitch.conf
 
29
  if ! nss_is_enabled "$name"
20
30
  then
21
31
    echo "/etc/nsswitch.conf: enable LDAP lookups for $name" >&2
22
 
    if grep -q '^'$name':' /etc/nsswitch.conf
 
32
    if grep -q '^[[:space:]]*'$name'[[:space:]]*:' /etc/nsswitch.conf
23
33
    then
24
34
      # modify an existing entry by just adding ldap to the end
25
 
      sed -i 's/^\('$name':.*[^[:space:]]\)[[:space:]]*$/\1 ldap/' /etc/nsswitch.conf
 
35
      sed -i 's/^\([[:space:]]*'$name'[[:space:]]*:.*[^[:space:]]\)[[:space:]]*$/\1 ldap/' /etc/nsswitch.conf
26
36
    else
27
37
      # append a new line
28
38
      printf '%-15s ldap\n' $name':' >> /etc/nsswitch.conf
29
39
    fi
 
40
    # invalidate nscd cache
 
41
    nscd -i "$name" > /dev/null 2>&1 || true
30
42
  fi
31
43
  # we're done
32
44
  return 0
35
47
# if /etc/nsswitch.conf contains passwd: ..ldap but not shadow: ...ldap
36
48
# warn the user that this will not work and offer to fix it
37
49
# (only do this if it seems we have switched to pam-auth-update)
38
 
if grep -q '^passwd:.*ldap' /etc/nsswitch.conf && \
39
 
   ! grep -q '^shadow:.*ldap' /etc/nsswitch.conf && \
 
50
if nss_is_enabled "passwd" && \
 
51
   ! nss_is_enabled "shadow" && \
40
52
   grep -q pam-auth-update /etc/pam.d/common-auth
41
53
then
42
54
  if db_input critical libpam-ldapd/enable_shadow
45
57
    db_get libpam-ldapd/enable_shadow
46
58
    if [ "$RET" = "true" ]
47
59
    then
48
 
      nss_enable shadow
 
60
      nss_enable "shadow"
49
61
    fi
50
62
  fi
51
63
fi