1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-03 05:18:09 +03:00

Merge pull request #22727 from fbuihuu/journald-preserve-acl-when-rotating

Journald preserve acl when rotating
This commit is contained in:
Luca Boccassi 2022-03-14 20:39:14 +00:00 committed by GitHub
commit e9c3312da1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -210,7 +210,10 @@ static void managed_journal_file_set_offline_internal(ManagedJournalFile *f) {
log_debug_errno(r, "Failed to re-enable copy-on-write for %s: %m, rewriting file", f->file->path);
r = copy_file_atomic(FORMAT_PROC_FD_PATH(f->file->fd), f->file->path, f->file->mode, 0, FS_NOCOW_FL, COPY_REPLACE | COPY_FSYNC | COPY_HOLES);
r = copy_file_atomic(FORMAT_PROC_FD_PATH(f->file->fd), f->file->path, f->file->mode,
0,
FS_NOCOW_FL,
COPY_REPLACE | COPY_FSYNC | COPY_HOLES | COPY_ALL_XATTRS);
if (r < 0) {
log_debug_errno(r, "Failed to rewrite %s: %m", f->file->path);
continue;

View File

@ -1488,7 +1488,7 @@ int copy_xattr(int fdf, int fdt, CopyFlags copy_flags) {
NULSTR_FOREACH(p, names) {
_cleanup_free_ char *value = NULL;
if (!(copy_flags & COPY_ALL_XATTRS) && !startswith(p, "user."))
if (!FLAGS_SET(copy_flags, COPY_ALL_XATTRS) && !startswith(p, "user."))
continue;
r = fgetxattr_malloc(fdf, p, &value);