Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#977410: rmlint: shell script ignores recheck (-p) result

2 views
Skip to first unread message

Benjamin Kästner

unread,
Dec 14, 2020, 4:00:03 PM12/14/20
to
Package: rmlint
Version: 2.8.0-3
Severity: normal
Tags: patch

Dear Maintainer,

rmlint's shell script template lib/formats/sh.sh contains `original_check', a function that checks whether the original has changed when option "-p" is used.

However, the result of the check is discarded, as `original_check's last if clause is missing a `return ERR_VAL'. This has been fixed upstream in version 2.10.1 by b9d328be2041e42813119d060c86893853b8e250.

Here's a simple test scenario:

$ mkdir test && cd test
$ echo hi > hello
$ cp hello world # files are the same
$ rmlint . # rmlint finds duplicate
$ echo world > world
$ diff hello world
1c1
< hi
---
> world
$ ./rmlint.sh -d -p
$ ls
hello rmlint.json

According to the shell script's documentation and output, -p should keep both "hello" and "world". However, after the steps above, "world" is gone. While the script's output says its "cancelling", the files are gone for
good.

Given that this might lead to data loss, I'm not sure whether "normal" is the correct severity, but this is my first bug report on Debian. The attached patch is the second half of upstream's b9d328be2041e42813119d060c86893853b8e250.

-- System Information:
Debian Release: 10.7
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-13-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages rmlint depends on:
ii libblkid1 2.33.1-0.1
ii libc6 2.28-10
ii libelf1 0.176-1.1
ii libglib2.0-0 2.58.3-2+deb10u2
ii libjson-glib-1.0-0 1.4.4-2

Versions of packages rmlint recommends:
pn rmlint-gui <none>

Versions of packages rmlint suggests:
pn rmlint-doc <none>

-- no debconf information
fix-original-check.diff

benjamin...@googlemail.com

unread,
Feb 15, 2021, 3:00:04 PM2/15/21
to
Hi,

is there anything missing for the patch to be merged? The current source
in sid/bullseye is also affected.

I'm more than happy to add any missing information if necessary.

Timo Röhling

unread,
Mar 22, 2021, 5:50:04 AM3/22/21
to
Control: severity -1 important

> Given that this might lead to data loss, I'm not sure whether "normal"
> is the correct severity

I think this should be fixed for Bullseye. Carlos, do you have time to
make an upload, or should I prepare an NMU?

Cheers
Timo

signature.asc

Timo Röhling

unread,
Apr 15, 2021, 5:40:04 PM4/15/21
to
Control: tags 977410 + patch
Control: tags 977410 + pending

Dear maintainer,

I've prepared an NMU for rmlint (versioned as 2.9.0-2.3). The diff
is attached to this message.

I require a sponsor to have it uploaded.

Regards.


--
⢀⣴⠾⠻⢶⣦⠀ ╭────────────────────────────────────────────────────╮
⣾⠁⢠⠒⠀⣿⡁ │ Timo Röhling │
⢿⡄⠘⠷⠚⠋⠀ │ 9B03 EBB9 8300 DF97 C2B1 23BF CC8C 6BDD 1403 F4CA │
⠈⠳⣄⠀⠀⠀⠀ ╰────────────────────────────────────────────────────╯
rmlint-2.9.0-2.3-nmu.diff
signature.asc
0 new messages