[Pkg-samba-maint] [samba] 01/01: Handle move of tdb files to private dir in samba-libs.preinst.

Ivo De Decker idd-guest at alioth.debian.org
Fri Nov 1 13:26:06 UTC 2013


This is an automated email from the git hooks/post-receive script.

idd-guest pushed a commit to branch master
in repository samba.

commit 49b4f98f8bae083652a5ccbf108f1b75359078f9
Author: Ivo De Decker <ivo.dedecker at ugent.be>
Date:   Fri Nov 1 11:43:36 2013 +0100

    Handle move of tdb files to private dir in samba-libs.preinst.
    
    Closes: #726472
---
 debian/changelog          |    4 ++++
 debian/control            |    8 +++++++
 debian/samba-libs.preinst |   52 +++++++++++++++++++++++++++++++++++++++++++++
 debian/samba.postinst     |   48 -----------------------------------------
 4 files changed, 64 insertions(+), 48 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 5984881..9bf409a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,10 @@ samba (2:4.0.10+dfsg-4) UNRELEASED; urgency=low
   * Move libtorture0 to samba-testsuite to reduce size of samba-libs and
     prevent dependency on libsubunit0.
 
+  [ Ivo De Decker ]
+  * Handle move of tdb files to private dir in samba-libs.preinst.
+    Closes: #726472
+
  -- Christian Perrier <bubulle at debian.org>  Tue, 22 Oct 2013 20:29:59 +0200
 
 samba (2:4.0.10+dfsg-3) unstable; urgency=low
diff --git a/debian/control b/debian/control
index 1da2ea7..e04d288 100644
--- a/debian/control
+++ b/debian/control
@@ -145,6 +145,14 @@ Replaces: libdcerpc-server0 (<< 2:4.0.9),
           libsmbclient-raw0 (<< 2:4.0.9),
           libsmbd0 (<< 2:4.0.9),
           libtorture0 (<< 2:4.0.9)
+# these conflicts can NOT be replaced by 'Breaks'
+# the old 3.6 packages should be removed before the new samba-libs is
+# unpacked, to avoid any code referencing the old location of the tdb files
+# see bug #726472
+Conflicts: libpam-smbpass (<< 2:4),
+           samba-common-bin (<< 2:4),
+           samba (<< 2:4),
+           winbind (<< 2:4)
 Description: Samba core libraries
  Samba is an implementation of the SMB/CIFS protocol for Unix systems,
  providing support for cross-platform file sharing with Microsoft Windows, OS X,
diff --git a/debian/samba-libs.preinst b/debian/samba-libs.preinst
new file mode 100644
index 0000000..3466d94
--- /dev/null
+++ b/debian/samba-libs.preinst
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+#
+
+set -e
+
+# Move files to private subdir now fhs patch is finally gone
+if [ "$1" = "install" ]
+then
+	for file in passdb.tdb secrets.tdb schannel_store.tdb idmap2.tdb
+	do
+		if [ -e /var/lib/samba/$file ]
+		then
+			if [ -e /var/lib/samba/private/$file ]
+			then
+				echo $file exists in /var/lib/samba and /var/lib/samba/private, aborting samba-libs preinst
+				echo rename one of them to allow the install/upgrade to continue
+				echo http://bugs.debian.org/726472
+				ls -al /var/lib/samba /var/lib/samba/private
+				exit 1
+			fi
+		fi
+	done
+	for file in passdb.tdb secrets.tdb schannel_store.tdb idmap2.tdb
+	do
+		if [ -e /var/lib/samba/$file ]
+		then
+			if ! [ -e /var/lib/samba/private/$file ]
+			then
+				if [ ! -d /var/lib/samba/private ]
+				then
+					mkdir /var/lib/samba/private
+				fi
+				mv /var/lib/samba/$file /var/lib/samba/private/$file
+			fi
+		fi
+	done
+
+	# bug #454770
+	# this is only relevant for upgrades from versions before 2:3.6.13-2
+	# this bug was never present in a stable release
+	if [ -e /etc/samba/idmap2.tdb ] \
+		&& ! [ -e /var/lib/samba/private/idmap2.tdb ]
+	then
+		mv /etc/samba/idmap2.tdb /var/lib/samba/private/idmap2.tdb
+	fi
+fi
+
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/samba.postinst b/debian/samba.postinst
index 3f67bd5..8556508 100644
--- a/debian/samba.postinst
+++ b/debian/samba.postinst
@@ -23,54 +23,6 @@ if dpkg --compare-versions "$2" lt-nl 2:3.6.15-2; then
 	fi
 fi
 
-# bug #454770
-if dpkg --compare-versions "$2" lt-nl 2:3.6.13-2 \
-	&& dpkg --compare-versions "$2" ge 3.0.24 \
-	&& [ -e /etc/samba/schannel_store.tdb ] \
-	&& ! [ -e /var/lib/samba/schannel_store.tdb ]
-then
-	mv /etc/samba/schannel_store.tdb /var/lib/samba/schannel_store.tdb
-fi
-
-# bug #454770
-if dpkg --compare-versions "$2" lt-nl 2:3.6.13-2 \
-	&& dpkg --compare-versions "$2" ge 3.0.24 \
-	&& [ -e /etc/samba/idmap2.tdb ] \
-	&& ! [ -e /var/lib/samba/idmap2.tdb ]
-then
-	mv /etc/samba/idmap2.tdb /var/lib/samba/idmap2.tdb
-fi
-
-# Move files to private subdir now fhs patch is finally gone
-if dpkg --compare-versions "$2" lt-nl 2:4.0.6
-then
-	for file in passdb.tdb secrets.tdb schannel_store.tdb idmap2.tdb
-	do
-		if [ -e /var/lib/samba/$file ]
-		then
-			if [ -e /var/lib/samba/private/$file ]
-			then
-				echo $file exists in /var/lib/samba and /var/lib/samba/private, aborting samba postinst
-				echo rename one of them to allow the upgrade to continue
-				echo http://bugs.debian.org/726472
-				ls -al /var/lib/samba /var/lib/samba/private
-				exit 1
-			fi
-		fi
-	done
-	for file in passdb.tdb secrets.tdb schannel_store.tdb idmap2.tdb
-	do
-		if [ -e /var/lib/samba/$file ]
-		then
-			if ! [ -e /var/lib/samba/private/$file ]
-			then
-				mv /var/lib/samba/$file /var/lib/samba/private/$file
-			fi
-		fi
-	done
-fi
-
-
 # add the sambashare group
 if ! getent group sambashare > /dev/null 2>&1
 then

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-samba/samba.git




More information about the Pkg-samba-maint mailing list