[Pkg-sssd-devel] sssd: Changes to 'ubuntu'

Stéphane Graber stgraber-guest at alioth.debian.org
Sun Feb 10 23:38:04 UTC 2013


 debian/changelog            |   17 ++++++++++++++++
 debian/libsss-sudo.postinst |   46 ++++++++++++++++++++++++++++++++++++++++++++
 debian/libsss-sudo.postrm   |   31 +++++++++++++++++++++++++++++
 debian/rules                |    2 +
 4 files changed, 96 insertions(+)

New commits:
commit 22e57644224bbd53cf2142de0ac5f33320d9f813
Author: Stéphane Graber <stgraber at ubuntu.com>
Date:   Sun Feb 10 18:37:57 2013 -0500

    release to raring

diff --git a/debian/changelog b/debian/changelog
index eed1536..2c6ba86 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+sssd (1.9.4-0ubuntu2) raring; urgency=low
+
+  * Merge from unreleased debian git
+    - Fix FTBFS on arm by raising test timeout to 30s
+    - Introduces postinst/postrm to setup nsswitch.conf when installing
+      libsss-sudo
+
+ -- Stéphane Graber <stgraber at ubuntu.com>  Sun, 10 Feb 2013 18:37:02 -0500
+
 sssd (1.9.4-0ubuntu1) raring; urgency=low
 
   * Merge from unreleased debian git

commit dfd4f45c938bc1b6532a8f1ade9857fafed5b69b
Author: Stéphane Graber <stgraber at ubuntu.com>
Date:   Sun Feb 10 18:35:46 2013 -0500

    Raise test timeout to 30s instead of 4s

diff --git a/debian/changelog b/debian/changelog
index ac160d6..5130109 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -44,6 +44,8 @@ sssd (1.9.4-1) UNRELEASED; urgency=low
   * Add postinst/postrm script for libsss-sudo. Those will add a "sudoers"
     entry to /etc/nsswitch.conf upon first installation of the package and
     will then take care of adding/removing sss from the stack as required.
+  * Set CK_DEFAULT_TIMEOUT to 30 so that slower buildds (armhf at least) can
+    run the tests without hitting the default 4s timeout.
 
  -- Timo Aaltonen <tjaalton at ubuntu.com>  Thu, 24 May 2012 14:46:39 +0300
 
diff --git a/debian/rules b/debian/rules
index 1383c91..87e3bb3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,6 +8,8 @@ include /usr/share/dpkg/buildflags.mk
 CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
 CFLAGS += -I/usr/include/samba-4.0
 
+export CK_DEFAULT_TIMEOUT=30
+
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
 APIDOCDIR = /usr/share/sssd

commit aba746bd82a63ff5ac9d6e5b0c7a27924182a594
Author: Stéphane Graber <stgraber at ubuntu.com>
Date:   Sun Feb 10 13:22:35 2013 -0500

    Add postinst/postrm for libsss-sudo
    
    Add postinst/postrm script for libsss-sudo. Those will add a "sudoers"
    entry to /etc/nsswitch.conf upon first installation of the package and
    will then take care of adding/removing sss from the stack as required.

diff --git a/debian/changelog b/debian/changelog
index c67dfa8..ac160d6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
 sssd (1.9.4-1) UNRELEASED; urgency=low
 
+  [ Timo Aaltonen ]
   * New upstream release 1.9.4.
   * Update the packaging for the new version, thanks Esko Järnfors!
     - Add libsss-idmap0, libsss-idmap-dev packages
@@ -39,6 +40,11 @@ sssd (1.9.4-1) UNRELEASED; urgency=low
   * rules: Pass --datadir, so the path in autogenerated python files is
     correctly substituted. (LP: #1079938)
 
+  [ Stéphane Graber ]
+  * Add postinst/postrm script for libsss-sudo. Those will add a "sudoers"
+    entry to /etc/nsswitch.conf upon first installation of the package and
+    will then take care of adding/removing sss from the stack as required.
+
  -- Timo Aaltonen <tjaalton at ubuntu.com>  Thu, 24 May 2012 14:46:39 +0300
 
 sssd (1.8.4-2) UNRELEASED; urgency=low
diff --git a/debian/libsss-sudo.postinst b/debian/libsss-sudo.postinst
index 64e9cc6..298c758 100644
--- a/debian/libsss-sudo.postinst
+++ b/debian/libsss-sudo.postinst
@@ -18,4 +18,50 @@ esac
 
 #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() {
+    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."
+        return
+    fi
+
+    if grep -q ^sudoers /etc/nsswitch.conf; then
+        # append 'sss' to the end of the line if it's not found already
+        sed -i --regexp-extended '
+          /^(sudoers):/ {
+            /\bsss\b/! s/$/ sss/
+          }
+        ' /etc/nsswitch.conf
+    else
+        echo "sudoers:        files sss" >> /etc/nsswitch.conf
+    fi
+}
+
+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
+    else
+        # upgrade
+        version="$2"
+
+        # Nothing to do here yet
+    fi
+fi
+
 exit 0
diff --git a/debian/libsss-sudo.postrm b/debian/libsss-sudo.postrm
new file mode 100644
index 0000000..aaeb4de
--- /dev/null
+++ b/debian/libsss-sudo.postrm
@@ -0,0 +1,31 @@
+#!/bin/sh
+set -e
+
+#DEBHELPER#
+
+# This code was taken from libnss-myhostname, which got it from nss-mdns:
+
+log() {
+    echo "$*"
+}
+
+remove_nss_entry() {
+    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."
+        return
+    fi
+    sed -i --regexp-extended '
+      /^(sudoers):/ {
+        s/\bsss\b//g
+        s/[[:space:]]+$//
+      }
+    ' /etc/nsswitch.conf
+}
+
+action="$1"
+
+if [ "$action" = remove ]; then
+    remove_nss_entry
+fi



More information about the Pkg-sssd-devel mailing list