[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#199849: unclear recommendation for debconf w/ dpkg-statoverride



Package: debian-policy
Version: 3.5.10.0
Severity: minor
Tags: patch

I think there is a missleading paragraph in the In the "files" chapter,
containing the recommendations for dpkg-statoverride usage. In the
particular case, the maintainer must case about how to call debconf and
the attached example does not show it clear enough. Here is my
change that may improve it, feel free to correct it where needed.


--- policy.sgml.orig	2003-07-03 13:32:25.000000000 +0200
+++ policy.sgml	2003-07-03 13:51:42.000000000 +0200
@@ -6495,12 +6495,14 @@
 	    should be installed setuid in the <tt>.deb</tt>.  Then the
 	    local system administrator can change this if they wish.
 	    If there are two standard ways of doing it, the package
-	    may use an alternative way instead of
-	    <prgn>dpkg-statoverride</prgn>: maintainer can use
-	    <tt>debconf</tt> to find out the preference, store it in the
-	    debconf database and set the permissions in the postinst
-	    script if necessary to accommodate the system
-	    administrator's choice.
+	    maintainer can use <tt>debconf</tt> to find out the
+	    preference, and call <prgn>dpkg-statoverride</prgn> in the
+	    maintainer script if necessary to accommodate the system
+	    administrator's choice. In this case you must make sure that the
+      dpkg-statoverride is not called when a such setting already
+      exists, ie. on upgrades (see example below). You also should tell
+      the administrator about what is happening there and you must never
+      apply dpkg-statoverride silently.
 	  </p>
 
 	  <p>
@@ -6517,9 +6519,12 @@
 	    <example>
 for i in /usr/bin/foo /usr/sbin/bar
 do
-  if ! dpkg-statoverride --list $i >/dev/null
+  if ! dpkg-statoverride --list $i >/dev/null 2>&1
   then
-    dpkg-statoverride --update --add sysuser root 4755 $i
+  #include: debconf processing, question about foo and bar
+    if [ "RET" = "true" ] ; then
+      dpkg-statoverride --update --add sysuser root 4755 $i
+    fi
   fi
 done
 	    </example>

MfG,
Eduard.

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux debian 2.4.20-wolk4.0s #2 Sam Mai 10 09:46:02 CEST 2003 i686
Locale: LANG=de_DE@euro, LC_CTYPE=de_DE@euro

-- no debconf information

--- policy.sgml.orig	2003-07-03 13:32:25.000000000 +0200
+++ policy.sgml	2003-07-03 13:51:42.000000000 +0200
@@ -6495,12 +6495,14 @@
 	    should be installed setuid in the <tt>.deb</tt>.  Then the
 	    local system administrator can change this if they wish.
 	    If there are two standard ways of doing it, the package
-	    may use an alternative way instead of
-	    <prgn>dpkg-statoverride</prgn>: maintainer can use
-	    <tt>debconf</tt> to find out the preference, store it in the
-	    debconf database and set the permissions in the postinst
-	    script if necessary to accommodate the system
-	    administrator's choice.
+	    maintainer can use <tt>debconf</tt> to find out the
+	    preference, and call <prgn>dpkg-statoverride</prgn> in the
+	    maintainer script if necessary to accommodate the system
+	    administrator's choice. In this case you must make sure that the
+      dpkg-statoverride is not called when a such setting already
+      exists, ie. on upgrades (see example below). You also should tell
+      the administrator about what is happening there and you must never
+      apply dpkg-statoverride silently.
 	  </p>
 
 	  <p>
@@ -6517,9 +6519,12 @@
 	    <example>
 for i in /usr/bin/foo /usr/sbin/bar
 do
-  if ! dpkg-statoverride --list $i >/dev/null
+  if ! dpkg-statoverride --list $i >/dev/null 2>&1
   then
-    dpkg-statoverride --update --add sysuser root 4755 $i
+  #include: debconf processing, question about foo and bar
+    if [ "RET" = "true" ] ; then
+      dpkg-statoverride --update --add sysuser root 4755 $i
+    fi
   fi
 done
 	    </example>

Reply to: