GNU bug report logs - #61966
diff -r reports identical devices nodes (maj/min) as different

Previous Next

Package: diffutils;

Reported by: Gioele Barabucci <gioele <at> svario.it>

Date: Sat, 4 Mar 2023 19:16:02 UTC

Severity: normal

To reply to this bug, email your comments to 61966 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-diffutils <at> gnu.org:
bug#61966; Package diffutils. (Sat, 04 Mar 2023 19:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gioele Barabucci <gioele <at> svario.it>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Sat, 04 Mar 2023 19:16:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gioele Barabucci <gioele <at> svario.it>
To: bug-diffutils <at> gnu.org
Subject: diff -r reports identical devices nodes (maj/min) as different
Date: Sat, 4 Mar 2023 17:54:20 +0100
Dear diff developers,

an issue related to the way diff compares directories that contain 
device nodes has been reported in <https://bugs.debian.org/929896>.

In a nutshell, identical device nodes are reported as different, but 
only during recursive comparisons (`-r`).

The following steps can reproduce this issue:

    $ mkdir a; sudo mknod a/null c 1 3
    $ sleep 1
    $ mkdir b; sudo mknod b/null c 1 3
    $ diff a/null b/null ; echo $?
    0
    $ diff -r a b ; echo $?
    File a/null is a character special file while file
    b/null is a character special file
    1

(Device 1/3 is the null character device, i.e. `/dev/null`.)

Removing the `sleep 1` command reduces (but does not eliminate) the 
probability of getting this faulty behavior.

Regards,

-- 
Gioele Barabucci




This bug report was last modified 1 year and 300 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.