Your message dated Thu, 15 Jun 2023 14:05:35 -0500
with message-id <[email protected]>
and subject line Fwd: Re: [Edrusb/DAR] Dar possibly ignores files with long
names (Issue #50)
has caused the Debian Bug report #912387,
regarding dar doesn't backup maximum length files
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
912387: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=912387
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: dar
Version: 2.5.8-3
Severity: normal
Tags: patch
Dear Maintainer,
Firefox when saving a complete web page seems to like to create very
long filenames, on ext4 this means 255 byte filenames (that doesn't
include the path, just the filename). dar then warns and doesn't
backup the file. This can be reproduced by creating a file of the
maximum length, 255 for ext4, and
`dar -c /tmp/test -R /tmp/path_to_file`
Filename provided by the operating system seems truncated in directory
/tmp/path_to_file ignoring it:
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
The problem is that file doesn't get backed up. This modification
changes the code to warn if it is the maximum length, and only skip if
it is larger than the maximum length. I'm not sure I like the logic
of ignoring it even in that case, if the file is that long, there is a
problem with determining the maximum file length, if it isn't actually
longer than the maximum file length, there's a bug someplace and I'm
not sure skipping it helps.
I would actually prefer that it not warn if it is the maximum length.
The file exists, back it up, it isn't the backup program's job to
critique the file names it is backing up.
>From aaa60fc12f3b73b304a0b5451dd6d8ba78b4838a Mon Sep 17 00:00:00 2001
From: David Fries <[email protected]>
Date: Tue, 30 Oct 2018 21:02:26 -0500
Subject: [PATCH 1/2] complain >= bail >
---
src/libdar/etage.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/libdar/etage.cpp b/src/libdar/etage.cpp
index 8d444869..8187e201 100644
--- a/src/libdar/etage.cpp
+++ b/src/libdar/etage.cpp
@@ -156,8 +156,11 @@ namespace libdar
ret->d_name[max_alloc_filename] = '\0'; // yes, one byte is
allocated for the terminal zero
if(strlen(ret->d_name) >= max_alloc_filename)
{
- ui.warning(tools_printf(gettext("Filename provided by
the operating system seems truncated in directory %s ignoring it: %s"),
dirname, ret->d_name));
- continue;
+ bool ignore = strlen(ret->d_name) > max_alloc_filename;
+ ui.warning(tools_printf(gettext("Filename provided by
the operating system seems truncated in directory %s%s: %s"),
+ dirname, ignore ? " ignoring it" : "",
ret->d_name));
+ if(ignore)
+ continue;
}
#else
while(!is_cache_dir && (ret = readdir(tmp)) != nullptr)
--
2.11.0
-- System Information:
Debian Release: 9.5
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.19.0+ (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=en_US.ISO-8859-15 (charmap=ISO-8859-15), LANGUAGE=C
(charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages dar depends on:
ii libassuan0 2.4.3-2
ii libattr1 1:2.4.47-2+b2
ii libbz2-1.0 1.0.6-8.1
ii libc6 2.24-11+deb9u3
ii libcap2 1:2.25-1
ii libdar64-5000 2.5.8-3+b1
ii libgcc1 1:6.3.0-18+deb9u1
ii libgcrypt20 1.7.6-2+deb9u3
ii libgpg-error0 1.26-2
ii libgpgme11 1.8.0-3+b2
ii liblzma5 5.2.2-1.2+b1
ii liblzo2-2 2.08-1.2+b2
ii libstdc++6 6.3.0-18+deb9u1
ii zlib1g 1:1.2.8.dfsg-5
dar recommends no packages.
Versions of packages dar suggests:
pn dar-docs <none>
pn par2 <none>
-- no debconf information
--- End Message ---
--- Begin Message ---
On Thu, Jun 15 2023, Denis Corbin wrote:
> Hi John
>
> after code review I come to the following conclusion:
>
> * this code is no more used because CAN_USE_READDIR_R macro is no more
> defined by the configure script (can't remember whether this was intentional
> or not! But that's not a bad thing at all)
> * the readdir_r (which was a thread-safe version of readdir system
> call) is never used, and thus the reading of a directory content
> always relies on readdir.
> * according to literature, today for most if not all standard C
> libraries, the readdir call is thread-safe and readdir_r is
> deprecated.
>
> Thus, the bug report you mention is also obsolete and does not more reflect
> any problem with libdar, if ever this was not a OS inconsistency (I could
> not find any error in the code related to readdir_r, but would need test
> further to be sure, which I will not do because readdir_r is deprecated).
>
> I will rather cleanup the code from these old stuff which make it complex and
> difficult to read, but this should not change anything in libdar's
> behavior
>
> Best Regards,
> Denis
>
> —
> Reply to this email directly, view it on GitHub, or unsubscribe.
> You are receiving this because you authored the thread.
--- End Message ---