[Pkg-owncloud-commits] [owncloud] 02/02: Use dpkg-statoverride to fix permissions
David Prévot
taffit at moszumanska.debian.org
Thu Oct 22 19:49:00 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch stable8
in repository owncloud.
commit 089ecf903ea0c5f1418bc85d853a7d63b239de6f
Author: David Prévot <taffit at debian.org>
Date: Thu Oct 22 12:44:02 2015 -0400
Use dpkg-statoverride to fix permissions
---
debian/lintian-overrides | 5 -----
debian/postinst | 12 ++++++++++--
debian/rules | 9 ---------
3 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/debian/lintian-overrides b/debian/lintian-overrides
index d3919a2..7b11597 100644
--- a/debian/lintian-overrides
+++ b/debian/lintian-overrides
@@ -1,8 +1,3 @@
-# User www-data has to write here.
-non-standard-dir-perm var/lib/owncloud/assets/ 2770 != 0755
-non-standard-dir-perm var/lib/owncloud/data/ 2770 != 0755
-non-standard-dir-perm var/lib/owncloud/backup/ 2770 != 0755
-non-standard-dir-perm var/lib/owncloud/themes/default/ 2770 != 0755
# This symlink points to a file provided by ca-certificates, which is a dependency
package-contains-broken-symlink etc/owncloud/ca-bundle.crt ../ssl/certs/ca-certificates.crt
# This symlink points to a file provided by libjs-jcrop, which is a dependency.
diff --git a/debian/postinst b/debian/postinst
index 9fa71d9..b1f343a 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -14,9 +14,17 @@ if [ "$1" = "configure" ] ; then
file=/var/log/owncloud.log
if [ ! -f $file ]; then
touch $file
- chown www-data:adm $file
- chmod 0640 $file
+ dpkg-statoverride --add --update www-data adm 0640 $file
fi
+ # Fix permissions
+ if ! dpkg-statoverride --list /etc/owncloud/ >/dev/null 2>&1; then
+ dpkg-statoverride --update --add www-data www-data 755 /etc/owncloud/
+ fi
+ for i in assets data backup themes/default ; do \
+ if ! dpkg-statoverride --list /var/lib/owncloud/$i 2>&1; then
+ dpkg-statoverride --update --add www-data www-data 2770 /var/lib/owncloud/$i
+ fi
+ done
# Update the database on upgrade
# Don’t let it fail, since it exits with 3 if no upgrade is necessary
if [ -e /etc/owncloud/config.php ] ; then
diff --git a/debian/rules b/debian/rules
index b897de2..2e3c0f9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -59,15 +59,6 @@ override_dh_install:
-X.md \
-X.yml
-override_dh_fixperms:
- dh_fixperms -X var/lib/owncloud
- chown www-data:www-data debian/owncloud/etc/owncloud/
- for i in assets data backup themes/default ; do \
- chown www-data:www-data debian/owncloud/var/lib/owncloud/$$i && \
- chmod 2770 debian/owncloud/var/lib/owncloud/$$i ; \
- done
- chmod +x debian/owncloud/usr/share/owncloud/occ
-
override_dh_installchangelogs:
dh_installchangelogs $(CURDIR)/debian/upstream/changelog
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list