Package: libc-bin
Version: 2.24-11+deb9u1
Tags: patch

Hello Aurelien et al.

As the subject says, the file /etc/nsswitch.conf is always updated to
the current default on upgrades when it is already the default.

This makes the file to have a different mtime without need,
which is bad for people using tripwire/samhain/etc.

We introduced this bug one year ago, when we moved the file from
base-files:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=827105

I can think of at least three ways to fix it, which I append
to this report:

In the first patch, we only modify the file if it's really different.
This is what base-files did for ages and what I initially proposed in
the patch for libc-bin (the bug was introduced by removing the cmp part).

In the second patch, we do consider the md5sum of the current default,
but we just return in such case, so the file is not updated.
This is probably the cleanest patch.

In the third patch, similar to the first one, we just don't check
the md5sum for the current default, and we fall back to the case
where the file has been modified.


I understand that this is not a big problem, but it is otherwise
trivial to fix (and it is formally a regression), so please consider
fixing this in the next upload for stretch, if there is one.

Thanks a lot.
--- a/debian/debhelper.in/libc-bin.postinst
+++ b/debian/debhelper.in/libc-bin.postinst
@@ -32,8 +32,10 @@ update_to_current_default() {
         return
         ;;
     esac
-    echo "Updating $2 to current default."
-    cp -p $1 $2
+    if ! cmp -s $1 $2; then
+      echo "Updating $2 to current default."
+      cp -p $1 $2
+    fi
   fi
 }
 
--- a/debian/debhelper.in/libc-bin.postinst
+++ b/debian/debhelper.in/libc-bin.postinst
@@ -26,6 +26,7 @@ update_to_current_default() {
         ;;
       # base-files 7.3 and libc-bin 2.22-12
       f8e97bf611374634c7cb3a6085503ab5)
+        return
         ;;
       # modified file
       *)
--- a/debian/debhelper.in/libc-bin.postinst
+++ b/debian/debhelper.in/libc-bin.postinst
@@ -25,8 +25,9 @@ update_to_current_default() {
       30b82cb1ce20d480703da2208a4607b4)
         ;;
       # base-files 7.3 and libc-bin 2.22-12
-      f8e97bf611374634c7cb3a6085503ab5)
-        ;;
+      # This is the current default, to be uncommented if it changes again
+      # f8e97bf611374634c7cb3a6085503ab5)
+      #   ;;
       # modified file
       *)
         return

Reply via email to