Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data loss with --replay and hard-linked files due to missing checksums. #672

Open
misieck opened this issue Sep 15, 2024 · 0 comments
Open

Comments

@misieck
Copy link

misieck commented Sep 15, 2024

Under certain conditions, rmlint does not calculate checksums of encountered files. All entries without checksums are seemingly interpreted by --replay as duplicates of the same file and marked for deletion.
One such condition that I found is when encountering hard links. Consider the following test setup:

\testdir
    - file_one 
    - file_one_link
    - file_two 
    - file_two_link

Sizes of file_one and file_two must differ. Running rmlint produces a rmlint.json file with no checksums in it, but the actions are correct.

# Duplicate(s):
    ls '/home/muser/rmlint/test/two'
    rm '/home/muser/rmlint/test/two_link'
    ls '/home/muser/rmlint/test/one'
    rm '/home/muser/rmlint/test/one_link'

Running rmlint --replay rmlint.json afterwards produces a script attempting to delete all but one of the listed files:

# Duplicate(s):
    ls '/home/muser/rmlint/test/one'
    rm '/home/muser/rmlint/test/one_link'
    rm '/home/muser/rmlint/test/two'
    rm '/home/muser/rmlint/test/two_link'

This would delete both two and two_link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant