[debian-edu-commits] debian-edu/ 01/01: Handling /etc/autofs_ldap_auth.conf file. The file requires to be a file and requires to have proper file permissions.

Mike Gabriel sunweaver at debian.org
Fri Nov 13 15:12:16 UTC 2015


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

sunweaver pushed a commit to branch master
in repository educlient.

commit 8327d3ae41e375ce59e5a46d11b268f47b36c90d
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Fri Nov 13 16:12:02 2015 +0100

    Handling /etc/autofs_ldap_auth.conf file. The file requires to be a file and requires to have proper file permissions.
---
 debian/educlient.postinst | 15 +++++++++++++++
 debian/educlient.prerm    |  6 ++++++
 2 files changed, 21 insertions(+)

diff --git a/debian/educlient.postinst b/debian/educlient.postinst
index b5b147d..139c471 100755
--- a/debian/educlient.postinst
+++ b/debian/educlient.postinst
@@ -119,6 +119,21 @@ for working_dir in ${ETC_DISTRIB_VERSION} ${ETC_DISTRIB_COMMON}  ${ETC_COMMON};
 		done
 done
 
+# Make sure, our version(s) of autofs_ldap_auth.conf have the right permissions, too:
+find /etc/educlient/* -name autofs_ldap_auth.conf | while read file; do
+	dpkg-statoverride --add --update root root 0600 "$file"
+done
+
+# Make sure, autofs_ldap_auth.conf has permissions root:root:0600
+# and that it is a file (otherwise, autofs-ldap will fail).
+if [ -h /etc/autofs_ldap_auth.conf ]; then
+	cd /etc/
+	link_target=$(readlink /etc/autofs_ldap_auth.conf)
+	rm -f /etc/autofs_ldap_auth.conf
+	cp -a "$link_target" "/etc/autofs_ldap_auth.conf"
+	cd - 1>/dev/null
+fi
+
 # Create /skole mount point
 if [ ! -d "/skole" ]; then 
 	mkdir /skole
diff --git a/debian/educlient.prerm b/debian/educlient.prerm
index 7034c71..ee88a0b 100755
--- a/debian/educlient.prerm
+++ b/debian/educlient.prerm
@@ -35,6 +35,12 @@ cat /etc/debian-edu/educlient.files-* | while read file;
 		fi
 	done
 
+# Drop all of our dpkg-statoverride entries
+dpkg-statoverride --list | grep -E "^[a-zA-Z0-9]+\ [a-zA-Z0-9]+\ [0-9]{3,4}\ /etc/educlient/.*$" | while read file; do
+	dpkg-statoverride --remove "$file"
+done
+
+
 # Revert first user to UID and GID 1000
 USERN="$(grep :x:500:500: /etc/passwd | cut -d ":" -f 1)"
 if [ -n "$USERN" ]; then

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/upstream/educlient.git



More information about the debian-edu-commits mailing list