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

Bug#1117467: trixie-pu: package jdupes/1.28.0-1+deb13u1



Package: release.debian.org
Severity: normal
Tags: trixie
X-Debbugs-Cc: jdupes@packages.debian.org, Bob Rosbag <debian@bobrosbag.nl>
Control: affects -1 + src:jdupes
User: release.debian.org@packages.debian.org
Usertags: pu

[ Reason ]
This update fixes a logic bug in jdupes that causes the program to incorrectly
ignore certain unique files. The issue was introduced by a flag overlap in the
code, where both FF_NOT_UNIQUE and FF_HASHDB_DIRTY were defined using the same
bit (1U << 5). As a result, files could be mistakenly marked as not unique due
to unrelated internal state changes.

This is a regression affecting users relying on the --unique (-u) option to
correctly detect unique files. It affects jdupes versions in stable and in
old-bpo only. The oldstable and the current testing/unstable is working fine.

[ Impact ]
If the update is not approved, users relying on jdupes to detect unique files
using the --unique (-u) option will continue to receive incorrect results.
Files that are in fact unique may be silently ignored due to a flag conflict,
leading to data loss, incorrect deduplication, or failure to identify
non-duplicate files. This can affect scripts, automation, and backups that
depend on accurate duplicate detection.

[ Tests ]
Extensive testing has been performed, including specific tests that reproduce
and verify the fix for this bug. These tests are already included in the
package’s CI through autopkgtest and are present in the version currently
available in Debian Sid. The fix has been manually validated as well, ensuring
correct behavior of the --unique option with various file combinations and
edge cases.

[ Risks ]
The fix is a minimal, safe one-line change to avoid the flag collision.

[ Checklist ]
  [x] *all* changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in (old)stable
  [x] the issue is verified as fixed in unstable

[ Changes ]
A single-line fix was applied to resolve a flag overlap in the jdupes.h header
file: the definition of FF_HASHDB_DIRTY was changed from (1U << 5) to (1U <<
6) to avoid conflict with FF_NOT_UNIQUE, which also used (1U << 5). This
change eliminates incorrect behavior where files were being mistakenly marked
as not unique due to internal hash database flags. No other code or logic was
changed.

[ Other info ]
The version currently in Debian Sid no longer exhibits this incorrect behavior
and did not require any additional changes. The issue was resolved upstream
prior to the current Sid upload, and this stable update simply backports the
minimal fix to ensure consistent behavior across releases.
diff -Nru jdupes-1.28.0/debian/changelog jdupes-1.28.0/debian/changelog
--- jdupes-1.28.0/debian/changelog	2024-08-05 19:05:55.000000000 -0300
+++ jdupes-1.28.0/debian/changelog	2025-10-05 22:45:33.000000000 -0300
@@ -1,3 +1,18 @@
+jdupes (1.28.0-1+deb13u1) trixie; urgency=medium
+
+  * debian/patches/020_fix-uniq-count.patch: created to fix flag overlap
+    between FF_NOT_UNIQUE and FF_HASHDB_DIRTY.
+    .
+    Both FF_NOT_UNIQUE and FF_HASHDB_DIRTY were defined using the same
+    bit (1U << 5), causing logic errors where files were incorrectly
+    marked as not unique due to hash database state. This commit moves
+    FF_HASHDB_DIRTY to (1U << 6) to eliminate the overlap. It fixes
+    incorrect behavior when detecting unique files with --unique or -u.
+    .
+    Closes: #1063079
+
+ -- Joao Eriberto Mota Filho <eriberto@debian.org>  Sun, 05 Oct 2025 22:45:33 -0300
+
 jdupes (1.28.0-1) unstable; urgency=medium
 
   * New upstream version 1.28.0.
diff -Nru jdupes-1.28.0/debian/patches/020_fix-uniq-count.patch jdupes-1.28.0/debian/patches/020_fix-uniq-count.patch
--- jdupes-1.28.0/debian/patches/020_fix-uniq-count.patch	1969-12-31 21:00:00.000000000 -0300
+++ jdupes-1.28.0/debian/patches/020_fix-uniq-count.patch	2025-10-05 22:45:33.000000000 -0300
@@ -0,0 +1,18 @@
+Description: Fix bit flag conflict: FF_NOT_UNIQUE and FF_HASHDB_DIRTY used same bit
+Author: Jody Bruchon <jody@jodybruchon.com>
+Origin: upstream
+Bug-Debian: https://bugs.debian.org/1063079
+Last-Update: 2025-10-06
+Index: jdupes-1.28.0/jdupes.h
+===================================================================
+--- jdupes-1.28.0.orig/jdupes.h
++++ jdupes-1.28.0/jdupes.h
+@@ -193,7 +193,7 @@ extern uint64_t flags, a_flags, p_flags;
+ #define FF_HAS_DUPES		(1U << 3)
+ #define FF_IS_SYMLINK		(1U << 4)
+ #define FF_NOT_UNIQUE		(1U << 5)
+-#define FF_HASHDB_DIRTY		(1U << 5)
++#define FF_HASHDB_DIRTY		(1U << 6)
+ 
+ /* Extra print flags */
+ #define PF_PARTIAL		(1U << 0)
diff -Nru jdupes-1.28.0/debian/patches/series jdupes-1.28.0/debian/patches/series
--- jdupes-1.28.0/debian/patches/series	2024-08-05 19:05:55.000000000 -0300
+++ jdupes-1.28.0/debian/patches/series	2025-10-05 22:45:33.000000000 -0300
@@ -1 +1,2 @@
 010_fix-FTBFS-Hurd.patch
+020_fix-uniq-count.patch

Reply to: