File: libnss-ldapd.config

package info (click to toggle)
nss-pam-ldapd 0.9.10-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 4,768 kB
  • sloc: ansic: 16,287; sh: 6,589; python: 3,368; xml: 1,925; makefile: 294; exp: 146
file content (42 lines) | stat: -rw-r--r-- 1,199 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh

set -e

# source debconf library.
. /usr/share/debconf/confmodule
db_version 2.0

#
# This is the first part of the script. In this part an attempt
# is made to get or guess the current configuration. This information
# is used later on to prompt the user and to provide a sensible
# default.
#

# find the names of services that are configured to use LDAP
# Note: this function is in libnss-ldapd.config and libnss-ldapd.postrm
nss_list_configured()
{
  sed -n \
      's/^[[:space:]]*\([a-z]*\)[[:space:]]*:.*[[:space:]]ldap\([[:space:]].*\)\?/\1/p' \
      /etc/nsswitch.conf \
    | xargs
}

# find name services that currently use LDAP and separate by commas
configured=`nss_list_configured | sed 's/[[:space:]][[:space:]]*/, /g'`
# store configured services when ldap is already configured
[ -n "$configured" ] && db_set libnss-ldapd/nsswitch "$configured"

#
# This is the second part of the script. In this part the configurable
# settings will be presented to the user for approval. The postinst
# will finaly perform the actual modifications.
#

# ask for which nsswitch options to configure
db_capb multiselect
db_input high libnss-ldapd/nsswitch || true
db_go || true

exit 0