Package: dump
Version: 0.4b47-4+~tjw12r5
Severity: normal
Dear Maintainer,
When using restore -C lgetflags returns 0 for symlinks as flags are not
vaild/settable on a symlink.
However, if EXT4_EXTENTS_FL is set then the verification fails saying
that the flags have changed.
./long_symlink: flags changed from 0x00080000 to 0x00000000.
-- System Information:
Debian Release: 12.7
APT prefers stable-security
APT policy: (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.1.0-25-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages dump depends on:
ii libblkid1 2.38.1-5+deb12u1
ii libbz2-1.0 1.0.8-5+b1
ii libc6 2.36-9+deb12u8
ii libcom-err2 1.47.0-2
ii libext2fs2 1.47.0-2
ii liblzo2-2 2.10-2
ii libreadline8 8.2-1.3
ii libselinux1 3.4-1+b6
ii tar 1.34+dfsg-1.2+deb12u1
ii zlib1g 1:1.2.13.dfsg-1
dump recommends no packages.
dump suggests no packages.
-- no debconf information
diff -urN dump-0.4b47.orig/restore/dirs.c dump-0.4b47/restore/dirs.c
--- dump-0.4b47.orig/restore/dirs.c 2022-05-03 10:02:27.000000000 +0000
+++ dump-0.4b47/restore/dirs.c 2022-05-03 10:02:27.000000000 +0000
@@ -791,7 +791,7 @@
do_compare_error;
}
#ifdef __linux__
- if (lgetflags(cp, &newflags) < 0) {
+ if (lgetflags(cp, &newflags, 0) < 0) {
if (node.flags != 0) {
warn("%s: lgetflags failed", cp);
do_compare_error;
diff -urN dump-0.4b47.orig/restore/extern.h dump-0.4b47/restore/extern.h
--- dump-0.4b47.orig/restore/extern.h 2022-05-03 10:02:27.000000000 +0000
+++ dump-0.4b47/restore/extern.h 2022-05-03 10:02:27.000000000 +0000
@@ -127,7 +127,7 @@
int setflags (int, unsigned long);
int lsetflags (const char *, unsigned long);
-int lgetflags (const char *, unsigned long *);
+int lgetflags (const char *, unsigned long *, unsigned long);
#ifdef USE_QFA
int Inode2Tapepos (dump_ino_t, long *, long long *, int);
diff -urN dump-0.4b47.orig/restore/tape.c dump-0.4b47/restore/tape.c
--- dump-0.4b47.orig/restore/tape.c 2022-05-03 10:02:27.000000000 +0000
+++ dump-0.4b47/restore/tape.c 2022-05-03 10:02:27.000000000 +0000
@@ -1805,7 +1805,7 @@
do_compare_error;
}
#ifdef __linux__
- if (lgetflags(name, &newflags) < 0) {
+ if (lgetflags(name, &newflags, flags) < 0) {
if (flags != 0) {
warn("%s: lgetflags failed", name);
do_compare_error;
diff -urN dump-0.4b47.orig/restore/utilities.c dump-0.4b47/restore/utilities.c
--- dump-0.4b47.orig/restore/utilities.c 2022-05-03 10:02:27.000000000
+0000
+++ dump-0.4b47/restore/utilities.c 2022-05-03 10:02:27.000000000 +0000
@@ -263,7 +263,7 @@
*/
#ifdef sunos
#else
- if (lgetflags (existing, &s) != -1 &&
+ if (lgetflags (existing, &s, 0) != -1 &&
lsetflags (existing, 0) != -1) {
ret = link(existing, new);
lsetflags(existing, s);
@@ -731,7 +731,7 @@
#endif /* DUMP_MACOSX */
int
-lgetflags(const char *path, unsigned long *flags)
+lgetflags(const char *path, unsigned long *flags, unsigned long inode_flags)
{
int err;
struct stat sb;
@@ -742,7 +742,7 @@
if (S_ISLNK(sb.st_mode) || S_ISFIFO(sb.st_mode)) {
// no way to get/set flags on a symlink
- *flags = 0;
+ *flags = inode_flags & EXT4_EXTENTS_FL;
return 0;
}
else