Package: libhesiod0
Version: 3.0.2-18.1
Severity: normal
Tags: patch
The postinst script for libhesiod0 will overwrite the existing
/etc/hesiod.conf whether or not it already exists, even on upgrades.
It should be changed to check that the argument it receives is configure
before overwriting hesiod.conf.
Also, the postinst script should use sed -i rather than sed followed by mv
-f, since that is slightly cleaner.
I've attached a patch to make these changes.
Thanks,
-Tim Abbott
diff -ur hesiod-3.0.2-old/debian/libhesiod0.postinst hesiod-3.0.2/debian/libhesiod0.postinst
--- hesiod-3.0.2-old/debian/libhesiod0.postinst 2007-08-03 16:09:04.000000000 -0400
+++ hesiod-3.0.2/debian/libhesiod0.postinst 2007-08-03 16:31:12.000000000 -0400
@@ -13,27 +13,28 @@
hesconf=/etc/hesiod.conf
-# If we don't have a hesiod.conf file yet, go ahead and populate it.
-if [ ! -f $hesconf ]; then
- echo "# This file determines the behavior of the Hesiod library." > $hesconf
- echo >> $hesconf
- echo "# This line should pretty much always be the same, unless you have a" >> $hesconf
- echo "# funny environment." >> $hesconf
- echo "lhs=$lhs" >> $hesconf
- echo >> $hesconf
- echo "# This determines the Hesiod domain. You must specify an rhs line." >> $hesconf
- echo "rhs=$rhs" >> $hesconf
- echo >> $hesconf
- echo "# This line specifies the class search order. You can reverse the" >> $hesconf
- echo "# order or leave out IN or HS if you want. Don't add spaces after the" >> $hesconf
- echo "# beginning of the value." >> $hesconf
- echo "classes=$classes" >> $hesconf
-else
- sed -e "s/^lhs=.*/lhs=$lhs/" \
- -e "s/^rhs=.*/rhs=$rhs/" \
- -e "s/^classes=.*/classes=$classes/" \
- < $hesconf > $hesconf.new
- mv -f $hesconf.new $hesconf
+if [ "$1" = "configure" ] && [ -z "$2" ]; then
+ # If we don't have a hesiod.conf file yet, go ahead and populate it.
+ if [ ! -f $hesconf ]; then
+ echo "# This file determines the behavior of the Hesiod library." > $hesconf
+ echo >> $hesconf
+ echo "# This line should pretty much always be the same, unless you have a" >> $hesconf
+ echo "# funny environment." >> $hesconf
+ echo "lhs=$lhs" >> $hesconf
+ echo >> $hesconf
+ echo "# This determines the Hesiod domain. You must specify an rhs line." >> $hesconf
+ echo "rhs=$rhs" >> $hesconf
+ echo >> $hesconf
+ echo "# This line specifies the class search order. You can reverse the" >> $hesconf
+ echo "# order or leave out IN or HS if you want. Don't add spaces after the" >> $hesconf
+ echo "# beginning of the value." >> $hesconf
+ echo "classes=$classes" >> $hesconf
+ else
+ sed -e "s/^lhs=.*/lhs=$lhs/" \
+ -e "s/^rhs=.*/rhs=$rhs/" \
+ -e "s/^classes=.*/classes=$classes/" \
+ -i $hesconf
+ fi
fi
#DEBHELPER#