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

« back to all changes in this revision

Viewing changes to debian/nslcd.config

  • Committer: Package Import Robot
  • Author(s): Arthur de Jong
  • Date: 2013-08-14 23:00:00 UTC
  • Revision ID: package-import@ubuntu.com-20130814230000-fddhr8jz2oickefb
Tags: 0.8.13-2
* debian/copyright: copyright year updates
* feedback from the debian-l10n-english contributors on the debconf
  templates and package descriptions (closes: #707193) (thanks Christian
  PERRIER and Justin B Rye)
* debconf translation updates:
  - Japanese by Kenshi Muto (closes: #711867)
  - Russian by Yuri Kozlov (closes: #711884)
  - Slovak by Slavko (closes: #711889)
  - Portuguese by Américo Monteiro (closes: #712231)
  - Danish by Joe Hansen (closes: #712311)
  - German by Chris Leick (closes: #712728)
  - French by Christian Perrier (closes: #712847)
  - Turkish by Atila KOÇ (closes: #712876)
  - Czech by Miroslav Kure (closes: #713047)
  - Italian by Beatrice Torracca (closes: #713987)
  - Dutch by Arthur de Jong
  - Swedish by Martin Bagge (closes: #714651)
* new debconf translations:
  - Polish by Michał Kułach (closes: #713921)
* debian/nslcd.config: properly handle preseeding and reading values
  from the configuration file by forcefully overwriting debconf values
  from nslcd.conf and not overwriting debconf values when reading other
  configuration files (closes: #717063)

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
{
23
23
  debconf_param="$1"
24
24
  cfg_param="$2"
25
 
  # overwrite debconf value if different from config file
26
25
  db_get "$debconf_param"
27
 
  debconf_value="$RET"
28
 
  # the first part avoids getting options that have an option MAP parameter
29
 
  cfgfile_value=`sed -n '/^'"$cfg_param"'[[:space:]]\(aliases\|ethers\|group\|hosts\|netgroup\|networks\|passwd\|protocols\|rpc\|services\|shadow\)[[:space:]]/!s/^'"$cfg_param"'[[:space:]]*\([^[:space:]].*[^[:space:]]\)[[:space:]]*$/\1/ip' "$cfgfile" | head -n 1`
30
 
  [ -n "$cfgfile_value" ] && [ "$debconf_value" != "$cfgfile_value" ] && db_set "$debconf_param" "$cfgfile_value"
 
26
  # ignore already-set debconf values unless force is used
 
27
  if [ -z "$RET" ] || [ "$force" = "force" ]
 
28
  then
 
29
    # the first part avoids getting options that have an optional MAP parameter
 
30
    cfgfile_value=`sed -n '/^'"$cfg_param"'[[:space:]]\(aliases\|ethers\|group\|hosts\|netgroup\|networks\|passwd\|protocols\|rpc\|services\|shadow\)[[:space:]]/!s/^'"$cfg_param"'[[:space:]]*\([^[:space:]].*[^[:space:]]\)[[:space:]]*$/\1/ip' "$cfgfile" | head -n 1`
 
31
    [ -n "$cfgfile_value" ] && db_set "$debconf_param" "$cfgfile_value"
 
32
  fi
31
33
  # we're done
32
34
  return 0
33
35
}
145
147
# parse a LDAP-like configuration file
146
148
parsecfg()
147
149
{
148
 
  cfgfile="$1"
 
150
  force="$1"
 
151
  cfgfile="$2"
149
152
  # check existance
150
153
  [ -f "$cfgfile" ] || return 0
151
154
  # find uri/host/port combo
152
155
  db_get nslcd/ldap-uris
153
 
  if [ -z "$RET" ]
 
156
  if [ -z "$RET" ] || [ "$force" = "force" ]
154
157
  then
155
158
    uris=`sed -n 's/^uri[[:space:]]*//ip' "$cfgfile" | tr '\n' ' '`
156
159
    if [ -z "$uris" ]
181
184
  read_config nslcd/ldap-sasl-krb5-ccname krb5_ccname
182
185
  # check ssl option
183
186
  db_get nslcd/ldap-starttls
184
 
  if [ -z "$RET" ]
 
187
  if [ -z "$RET" ] || [ "$force" = "force" ]
185
188
  then
186
189
    if grep -qi '^ssl[[:space:]]*start_*tls' "$cfgfile"
187
190
    then
193
196
  fi
194
197
  # check reqcert option
195
198
  db_get nslcd/ldap-reqcert
196
 
  if [ -z "$RET" ]
 
199
  if [ -z "$RET" ] || [ "$force" = "force" ]
197
200
  then
198
201
    reqcert=`sed -n 's/^tls_\(reqcert\|checkpeer\)[[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\2/ip' "$cfgfile" | head -n 1`
199
202
    # normalise value
209
212
if [ -f "$CONFFILE" ]
210
213
then
211
214
  # parse current configuration
212
 
  parsecfg "$CONFFILE"
 
215
  parsecfg force "$CONFFILE"
213
216
  # deduce auth-type from configuration file
214
217
  if grep -qi '^sasl_mech[[:space:]]' "$CONFFILE"
215
218
  then
222
225
  fi
223
226
else
224
227
  # first match wins
225
 
  parsecfg /etc/libnss-ldap.conf
226
 
  parsecfg /etc/pam_ldap.conf
227
 
  parsecfg /etc/ldap/ldap.conf
228
 
  parsecfg /etc/ldap.conf
 
228
  parsecfg noforce /etc/libnss-ldap.conf
 
229
  parsecfg noforce /etc/pam_ldap.conf
 
230
  parsecfg noforce /etc/ldap/ldap.conf
 
231
  parsecfg noforce /etc/ldap.conf
229
232
  parsesys
230
233
  # fallback default values
231
234
  db_get nslcd/ldap-uris