[Pkg-samba-maint] [samba] 01/01: abort if tdb move can't be done on upgrade
Ivo De Decker
idd-guest at alioth.debian.org
Mon Oct 21 22:25:31 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 d3cccdc5a681371405219c99241f6a6a806e1c45
Author: Ivo De Decker <ivo.dedecker at ugent.be>
Date: Mon Oct 21 23:05:55 2013 +0200
abort if tdb move can't be done on upgrade
if the same tdb is present in /var/lib/samba and /var/lib/samba/private, abort
the upgrade (bug 726472)
---
debian/changelog | 2 ++
debian/samba.postinst | 41 +++++++++++++++++------------------------
2 files changed, 19 insertions(+), 24 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 86619ba..77b02bc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,8 @@ samba (2:4.0.10+dfsg-3) UNRELEASED; urgency=low
* Add wrapper for cups-config to filter out
-L/usr/lib/${DEB_HOST_MULTIARCH}, to work around build-failure.
* Also add other build-deps which were present in samba 2:3.6.19-1.
+ * if the same tdb file is present in /var/lib/samba and
+ /var/lib/samba/private, abort the upgrade to work around #726472 for now.
[ Steve Langasek ]
* Don't fail on errors from testparm in the samba init script.
diff --git a/debian/samba.postinst b/debian/samba.postinst
index 94667f8..28c606e 100644
--- a/debian/samba.postinst
+++ b/debian/samba.postinst
@@ -42,33 +42,26 @@ then
fi
# Move files to private subdir now fhs patch is finally gone
-if dpkg --compare-versions "$2" lt-nl 2:4.0.6 \
- && [ -e /var/lib/samba/schannel_store.tdb ] \
- && ! [ -e /var/lib/samba/private/schannel_store.tdb ]
+if dpkg --compare-versions "$2" lt-nl 2:4.0.6
then
- mv /var/lib/samba/schannel_store.tdb /var/lib/samba/private/schannel_store.tdb
+ 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
+ else
+ mv /var/lib/samba/$file /var/lib/samba/private/$file
+ fi
+ fi
+ done
fi
-if dpkg --compare-versions "$2" lt-nl 2:4.0.6 \
- && [ -e /var/lib/samba/idmap2.tdb ] \
- && ! [ -e /var/lib/samba/private/idmap2.tdb ]
-then
- mv /var/lib/samba/idmap2.tdb /var/lib/samba/private/idmap2.tdb
-fi
-
-if dpkg --compare-versions "$2" lt-nl 2:4.0.6 \
- && [ -e /var/lib/samba/passdb.tdb ] \
- && ! [ -e /var/lib/samba/private/passdb.tdb ]
-then
- mv /var/lib/samba/passdb.tdb /var/lib/samba/private/passdb.tdb
-fi
-
-if dpkg --compare-versions "$2" lt-nl 2:4.0.6 \
- && [ -e /var/lib/samba/secrets.tdb ] \
- && ! [ -e /var/lib/samba/private/secrets.tdb ]
-then
- mv /var/lib/samba/secrets.tdb /var/lib/samba/private/secrets.tdb
-fi
# add the sambashare group
if ! getent group sambashare > /dev/null 2>&1
--
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