jonelo / jacksum

A hash utility, est. 2002, FLOSS. 489 hash functions, HMAC support, cross platform, feature-rich, multi threaded. CLI and API. Recursive hashing, predefined and customizable formats, verify data integrity and find ok/failed/missing/new files, find files by their hashes, find the hash function to a hash. GUI provided by HashGarten.
https://jacksum.net
GNU General Public License v3.0
43 stars 5 forks source link

On Linux during checking, Jacksum 3.1.0 replaces the backslash for filenames #17

Closed jonelo closed 2 years ago

jonelo commented 2 years ago

Describe the bug On GNU/Linux filenames are allowed to contain backslashes. On GNU/Linux Jacksum 3.1.0 replaces the backslash for filenames from checkfiles, because it thinks the checkfile was created on Microsoft Windows.

To Reproduce

$ java -jar jacksum-3.1.0.jar -a sha256 -x -o /tmp/checkfile "/lib/systemd/system/system-systemd\x2dcryptsetup.slice"
$ cat /tmp/checkfile
9d02f98b0a8c192e7724ea1aae824d27754964aad8bcacae5b4bf6f95dc6edfc /lib/systemd/system/system-systemd\x2dcryptsetup.slice
$ java -jar jacksum-3.1.0.jar -a sha256 -x -c /tmp/checkfile -V nosummary
Jacksum: Error: /lib/systemd/system/system-systemd/x2dcryptsetup.slice: does not exist.
  MISSING  /lib/systemd/system/system-systemd/x2dcryptsetup.slice
$

Expected behavior The backslash shouldn't be replaced with a slash, and it should be possible to verify the integrity of the file.

Screenshots n/a

Environment (please complete the following information):

$  lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:    20.04
Codename:   focal

Additional context The filename is stored correctly in /tmp/checkfile, but the parser replaces the back slash which it shouldn't do.

jonelo commented 2 years ago

fixed in commit https://github.com/jonelo/jacksum/commit/79b15d7b6daa1afb8e885e9430ea731bb9070508

verification:

$ java -jar jacksum-3.2.0-SNAPSHOT.jar -a sha256 -x -c checkfile -V nosummary
       OK  /lib/systemd/system/system-systemd\x2dcryptsetup.slice