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

« back to all changes in this revision

Viewing changes to debian/nslcd.config

  • Committer: Package Import Robot
  • Author(s): Arthur de Jong
  • Date: 2011-12-31 13:30:00 UTC
  • Revision ID: package-import@ubuntu.com-20111231133000-c2lpa27xp5s6q481
Tags: 0.8.5
* support larger gecos values (closes: #640781)
* updated Swedish debconf translation by Martin Bagge (closes: #640623)
* consistently handle whitespace in configuration file during package
  configuration (thanks Nick) (closes: #641619)
* add a versioned dependency on libpam0g to ensure the PAM libraries are
  multiarch-aware
* in debconf, treat the "hard" value for tls_reqcert as if it was "demand"
  (closes: #642347)
* reduce loglevel of user not found messages to avoid spamming the logs
  with useless information (thanks Wakko Warner) (closes: #641820)
* other logging improvements
* keep nslcd running during package upgrades (closes: #644892)
* explicitly parse numbers as base 10 (thanks Jakub Hrozek)
* implement FreeBSD group membership NSS function (thanks Tom Judge)
* fix an issue where changes in /etc/nsswitch.conf were not correctly
  picked up and could lead to lookups being disabled on upgrade
  (closes: #645599)
* fix an issue with detecting the uid of the calling process and log
  denied shadow requests in debug mode
* fix a typo in the disconnect logic code (thanks Martin Poole)
* enable hardening options during build
* implement configuration file handling in pynslcd and other pynslcd
  improvements (pynslcd is not in a Debian package yet)
* update debian/copyright

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#
22
22
 
23
23
# read a configuration value from the specified file
24
 
# (it takes care in not overwriting a previously written value)
 
24
# (it takes care in not overwriting a previously written debconf value)
25
25
read_config()
26
26
{
27
27
  debconf_param="$1"
29
29
  # overwrite debconf value if different from config file
30
30
  db_get "$debconf_param"
31
31
  debconf_value="$RET"
32
 
  cfgfile_value=`sed -n 's/^'"$cfg_param"'[[:space:]]*\([^[:space:]].*[^[:space:]]\)[[:space:]]*$/\1/ip' "$cfgfile" | tail -n 1`
 
32
  cfgfile_value=`sed -n 's/^'"$cfg_param"'[[:space:]]*\([^[:space:]].*[^[:space:]]\)[[:space:]]*$/\1/ip' "$cfgfile" | head -n 1`
33
33
  [ -n "$cfgfile_value" ] && [ "$debconf_value" != "$cfgfile_value" ] && db_set "$debconf_param" "$cfgfile_value"
34
34
  # we're done
35
35
  return 0
41
41
  domain=`hostname --domain` || true
42
42
  [ -z "$domain" ] && domain=`hostname --nis | grep '\.'` || true
43
43
  [ -z "$domain" ] && domain=`hostname --fqdn | sed -n 's/^[^.]*\.//p'` || true
44
 
  [ -z "$domain" ] && domain=`sed -n 's/^ *\(domain\|search\) *\([^ ]*\) *$/\2/p' /etc/resolv.conf | head -n 1` || true
 
44
  [ -z "$domain" ] && domain=`sed -n 's/^[[:space:]]*\(domain\|search\)[[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\2/p' /etc/resolv.conf | tail -n 1` || true
45
45
  echo "$domain"
46
46
}
47
47
 
57
57
  # try to lookup _ldap._tcp SRV records
58
58
  if [ -n "$domain" ]
59
59
  then
60
 
    server=`host -N 2 -t SRV _ldap._tcp.$domain 2> /dev/null | grep -v NXDOMAIN | awk '{print $NF}' | head -1 | sed 's/\.$//'` || true
 
60
    server=`host -N 2 -t SRV _ldap._tcp.$domain 2> /dev/null | grep -v NXDOMAIN | awk '{print $NF}' | head -n 1 | sed 's/\.$//'` || true
61
61
    if [ -n "$server" ]
62
62
    then
63
63
      echo "ldap://$server/"
159
159
    if [ -z "$uris" ]
160
160
    then
161
161
      hosts=`sed -n 's/^host[[:space:]]*//ip' "$cfgfile"`
162
 
      port=`sed -n 's/^port[[:space:]]*//ip' "$cfgfile" | tail -n 1`
 
162
      port=`sed -n 's/^port[[:space:]]*//ip' "$cfgfile" | head -n 1`
163
163
      for host in $hosts
164
164
      do
165
165
        if [ -z "$port" ] || (echo "$host" | grep -q ':' )
198
198
  db_get nslcd/ldap-reqcert
199
199
  if [ -z "$RET" ]
200
200
  then
201
 
    reqcert=`sed -n 's/^tls_\(reqcert\|checkpeer\)[[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\2/ip' "$cfgfile" | tail -n 1`
 
201
    reqcert=`sed -n 's/^tls_\(reqcert\|checkpeer\)[[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\2/ip' "$cfgfile" | head -n 1`
202
202
    # normalise value
203
 
    reqcert=`echo "$reqcert" | tr 'A-Z' 'a-z' | sed 's/^no$/never/;s/^yes$/demand/'`
 
203
    reqcert=`echo "$reqcert" | tr 'A-Z' 'a-z' | sed 's/^no$/never/;s/^yes$/demand/;s/^hard$/demand/'`
204
204
    [ -n "$reqcert" ] && db_set nslcd/ldap-reqcert "$reqcert"
205
205
  fi
206
206
  # we're done