Control: tags -1 + patch

The origin of the bug is in line 411 of dbconfig-generate-include.

On upgrade, any new file is written to a temp file, which has default
permissions (as in, those of the user running the script, normally root,
and their umask).

Attached is a patch that replicates the permissions of any old
configuration to the tempfile so they do not get lost.

Cheers,
Nik

-- 
Dominik George (Vorstandsvorsitzender, Pädagogischer Leiter)
Teckids e.V. - Erkunden, Entdecken, Erfinden.
https://www.teckids.org

diff -Nru dbconfig-common-1.8.47+nmu2/dbconfig-generate-include 
dbconfig-common-1.8.47+nmu3/dbconfig-generate-include
--- dbconfig-common-1.8.47+nmu2/dbconfig-generate-include       2014-10-13 
21:05:57.000000000 +0200
+++ dbconfig-common-1.8.47+nmu3/dbconfig-generate-include       2014-10-29 
16:38:09.000000000 +0100
@@ -408,6 +408,10 @@
                ucf --debconf-ok "$tmpout" "$outputfile" >&2
                rm -f "$tmpout"
        else
+               # Replicate permissions of original file to temp file
+               # so it doesn't get lost
+               chmod --reference="$outputfile" "$tmpout"
+               chown --reference="$outputfile" "$tmpout"
                mv "$tmpout" "$outputfile"
        fi
        check_permissions
diff -Nru dbconfig-common-1.8.47+nmu2/debian/changelog 
dbconfig-common-1.8.47+nmu3/debian/changelog
--- dbconfig-common-1.8.47+nmu2/debian/changelog        2014-10-13 
21:31:13.000000000 +0200
+++ dbconfig-common-1.8.47+nmu3/debian/changelog        2014-10-29 
16:43:27.000000000 +0100
@@ -1,3 +1,11 @@
+dbconfig-common (1.8.47+nmu3) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Do not remove permissions from include files on upgrade,
+    thanks to Simon Bruder. (Closes: #767248)
+
+ -- Dominik George <n...@naturalnet.de>  Wed, 29 Oct 2014 16:38:19 +0100
+
 dbconfig-common (1.8.47+nmu2) unstable; urgency=low
 
   * Non-maintainer upload.
diff -Naupr dbconfig-common-1.8.47+nmu2.old/dbconfig-generate-include dbconfig-common-1.8.47+nmu3/dbconfig-generate-include
--- dbconfig-common-1.8.47+nmu2.old/dbconfig-generate-include	2014-10-13 21:05:57.000000000 +0200
+++ dbconfig-common-1.8.47+nmu3/dbconfig-generate-include	2014-10-29 16:49:01.505051762 +0100
@@ -408,6 +408,12 @@ if [ "$outputfile" ]; then
 		ucf --debconf-ok "$tmpout" "$outputfile" >&2
 		rm -f "$tmpout"
 	else
+		# Replicate permissions of original file to temp file
+		# so it doesn't get lost
+		if [ -e "$outputfile" ]; then
+			chmod --reference="$outputfile" "$tmpout"
+			chown --reference="$outputfile" "$tmpout"
+		fi
 		mv "$tmpout" "$outputfile"
 	fi
 	check_permissions
diff -Naupr dbconfig-common-1.8.47+nmu2.old/debian/changelog dbconfig-common-1.8.47+nmu3/debian/changelog
--- dbconfig-common-1.8.47+nmu2.old/debian/changelog	2014-10-13 21:31:13.000000000 +0200
+++ dbconfig-common-1.8.47+nmu3/debian/changelog	2014-10-29 16:43:27.677039956 +0100
@@ -1,3 +1,11 @@
+dbconfig-common (1.8.47+nmu3) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Do not remove permissions from include files on upgrade,
+    thanks to Simon Bruder. (Closes: #767248)
+
+ -- Dominik George <n...@naturalnet.de>  Wed, 29 Oct 2014 16:38:19 +0100
+
 dbconfig-common (1.8.47+nmu2) unstable; urgency=low
 
   * Non-maintainer upload.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to