fix ldap postinst
authorBdale Garbee <bdale@gag.com>
Sat, 28 Mar 2009 12:32:38 +0000 (06:32 -0600)
committerBdale Garbee <bdale@gag.com>
Sat, 28 Mar 2009 12:32:38 +0000 (06:32 -0600)
debian/changelog
debian/postinst
debian/sudo-ldap.postinst
debian/sudo-ldap.postrm [new file with mode: 0644]

index b1962298d7430997139f242c7b34b64b51c00919..7ba6db99943d68773cdd036fe264a7db409e5cfe 100644 (file)
@@ -1,6 +1,8 @@
 sudo (1.6.9p17-3) UNRELEASED; urgency=low
 
-  * fix ldap config file path for sudo-ldap package, closes: #430826
+  * fix ldap config file path for sudo-ldap package, including creating
+    a symlink in postinst and cleaning it up in postrm for the sudo-ldap
+    package, closes: #430826
 
  -- Bdale Garbee <bdale@gag.com>  Wed, 11 Mar 2009 10:44:21 -0600
 
index b89a8a533ec651bb3797882bd6738aeef8c7c418..2229c83598147e87584f2aabf3385dc76eda2774 100644 (file)
@@ -63,10 +63,4 @@ if ($gid != 27) {
 print "Creating group 'sudo' with gid = $gid\n";
 system("groupadd -g $gid sudo");
 
-# create symlink to ease transition to new path for ldap config
-# if old config file exists and new one doesn't
-if (-e "/etc/ldap/ldap.conf" && ! -e "/etc/sudo-ldap.conf") {
-  system("ln -s ldap/ldap.conf /etc/sudo-ldap.conf");
-}
-
 print "";
index 36cdd235c89e4de80576edfa280def1318d16944..89cc56ca1a549d3eca7e9549473079bbc800e564 100644 (file)
@@ -61,4 +61,10 @@ if ($gid != 27) {
 print "Creating group 'sudo' with gid = $gid\n";
 system("groupadd -g $gid sudo");
 
+# create symlink to ease transition to new path for ldap config
+# if old config file exists and new one doesn't
+if (-e "/etc/ldap/ldap.conf" && ! -e "/etc/sudo-ldap.conf") {
+  system("ln -s ldap/ldap.conf /etc/sudo-ldap.conf");
+}
+
 print "";
diff --git a/debian/sudo-ldap.postrm b/debian/sudo-ldap.postrm
new file mode 100644 (file)
index 0000000..58bb84b
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh -e
+
+case "$1" in
+  purge)
+       rm -f /etc/sudo-ldap.conf
+  ;;
+
+  remove|upgrade|deconfigure)
+  ;;
+
+  failed-upgrade)
+  ;;
+
+  *)
+        echo "unknown argument --> $1" >&2
+        exit 0
+  ;;
+esac
+
+#DEBHELPER#