Xattr remove empty
All checks were successful
Source release / source-package (push) Successful in 36s

This commit is contained in:
Mario Fetka
2026-05-25 21:23:02 +02:00
parent b031402933
commit 5a701740fb

View File

@@ -91,20 +91,42 @@ int mars_nwe_set_archive_info(char *unixname,
if (set_date) {
U16_TO_16(archive_date, d.archive_date);
d.flags |= MARS_NWE_ARCHIVE_HAS_DATE;
if (archive_date)
d.flags |= MARS_NWE_ARCHIVE_HAS_DATE;
else
d.flags &= (uint8)~MARS_NWE_ARCHIVE_HAS_DATE;
}
if (set_time) {
U16_TO_16(archive_time, d.archive_time);
d.flags |= MARS_NWE_ARCHIVE_HAS_TIME;
if (archive_time)
d.flags |= MARS_NWE_ARCHIVE_HAS_TIME;
else
d.flags &= (uint8)~MARS_NWE_ARCHIVE_HAS_TIME;
}
if (set_archiver) {
U32_TO_BE32(archiver_id, d.archiver_id);
d.flags |= MARS_NWE_ARCHIVE_HAS_ARCHIVER;
if (archiver_id)
d.flags |= MARS_NWE_ARCHIVE_HAS_ARCHIVER;
else
d.flags &= (uint8)~MARS_NWE_ARCHIVE_HAS_ARCHIVER;
}
if (!unixname || !*unixname)
return(0);
if (!d.flags) {
if (removexattr(unixname, MARS_NWE_ARCHIVE_XATTR)) {
int err = errno;
if (err != ENODATA
#ifdef ENOATTR
&& err != ENOATTR
#endif
)
XDPRINTF((5,0,"mars_nwe archive xattr remove ignored for %s errno=%d", unixname, err));
}
return(0);
}
if (setxattr(unixname, MARS_NWE_ARCHIVE_XATTR, &d, sizeof(d), 0)) {
int err = errno;
/* Compatibility rule: NetWare archive metadata has no POSIX field.