Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • mika/sssd
  • guillem/debian-pkg-sssd
  • john.veitch/sssd
  • jgullberg/sssd
  • gioele/sssd
  • oktay454/sssd
  • sergiodj/sssd
  • 3v1n0/sssd
  • jfalk-guest/sssd
  • sathieu/sssd
  • dpward/sssd
  • sssd-team/sssd
  • ahasenack/sssd
  • jbicha/sssd
  • yrro-guest/sssd
15 results
Show changes
Commits on Source (3)
......@@ -11,6 +11,7 @@ Build-Depends:
debhelper-compat (= 12),
dh-apparmor,
dh-python,
dh-sequence-installnss,
dnsutils,
docbook-xml,
docbook-xsl,
......
passwd last sss
group last sss
shadow last sss
netgroup last sss
services last sss
automount last sss
#!/bin/sh
set -e
#DEBHELPER#
# This code was taken from libnss-myhostname, which got it from nss-mdns:
log() {
echo "$*"
}
# try to insert sss entries to the passwd, group, shadow and netgroup
# lines in /etc/nsswitch.conf to automatically enable libnss-sss
# support; do not change the configuration if the lines already
# references some sss lookups
insert_nss_entry() {
# Add the `automount` database to nsswitch.conf if it's not there.
insert_nss_automount_db () {
log "Checking NSS setup..."
# abort if /etc/nsswitch.conf does not exist
if ! [ -e /etc/nsswitch.conf ]; then
log "Could not find /etc/nsswitch.conf."
if ! [ -e "${DPGK_ROOT}/etc/nsswitch.conf" ]; then
log "Could not find ${DPKG_ROOT}/etc/nsswitch.conf."
return
fi
# append 'sss' to the end of the line if it's not found already
sed -i --regexp-extended '
/^(passwd|group|shadow|netgroup|services|automounter):/ {
/\bsss\b/! s/$/ sss/
}
' /etc/nsswitch.conf
# and add a new entry for automount if it's not there
if ! grep -q automount /etc/nsswitch.conf; then
log "Adding an entry for automount."
echo "automount: sss" >> /etc/nsswitch.conf
if ! grep -q automount "${DPKG_ROOT}/etc/nsswitch.conf" ; then
log "Setting up empty automount NSS database"
echo "automount: " >> "${DPKG_ROOT}/etc/nsswitch.conf"
fi
}
......@@ -38,16 +26,17 @@ action="$1"
if [ configure = "$action" ]; then
if [ -z "$2" ]; then
log "First installation detected..."
# first install: setup the recommended configuration (unless
# nsswitch.conf already contains sss entries)
insert_nss_entry
# first install: setup automount NSS database.
insert_nss_automount_db
else
# upgrade
version="$2"
# fix automount typo
if dpkg --compare-versions $version lt "2.2.3-3"; then
sed -i 's/automounter/automount/' /etc/nsswitch.conf
sed -i 's/automounter/automount/' "${DPKG_ROOT}/etc/nsswitch.conf"
fi
fi
fi
#DEBHELPER#
......@@ -3,32 +3,26 @@ set -e
#DEBHELPER#
# This code was taken from libnss-myhostname, which got it from nss-mdns:
log() {
echo "$*"
}
remove_nss_entry() {
remove_nss_automount_db () {
log "Checking NSS setup..."
# abort if /etc/nsswitch.conf does not exist
if ! [ -e /etc/nsswitch.conf ]; then
log "Could not find /etc/nsswitch.conf."
if ! [ -e "${DPKG_ROOT}/etc/nsswitch.conf" ]; then
log "Could not find ${DPKG_ROOT}/etc/nsswitch.conf."
return
fi
sed -i --regexp-extended '
/^(passwd|group|shadow|netgroup|services):/ {
s/\bsss\b//g
s/[[:space:]]+$//
}
' /etc/nsswitch.conf
sed -i '/^automount/d' /etc/nsswitch.conf
# Remove NSS databases: `automount` and `automounter` (legacy).
sed -i '/^automount/d' "${DPKG_ROOT}/etc/nsswitch.conf"
}
case "$1" in
remove|purge)
if [ "${DPKG_MAINTSCRIPT_PACKAGE_REFCOUNT:-1}" = 1 ]; then
remove_nss_entry
remove_nss_automount_db
fi
;;
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
......