diff options
author | Andrej Lajovic <andrej.lajovic@ad-vega.si> | 2021-08-09 01:43:54 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-08-11 17:48:10 +0200 |
commit | 23e026de254df54119e6565bf7b638b9b83ec4fd (patch) | |
tree | 36f45ceabf1fc254c1d93163707ee4b79b4ed066 /src/shared/copy.h | |
parent | a0c5a3f0c052fc05542945688e20784b55a1303d (diff) | |
download | systemd-23e026de254df54119e6565bf7b638b9b83ec4fd.tar.gz |
shared/copy: add a new flag COPY_ALL_XATTRS
When the flag COPY_ALL_XATTRS is set, it causes the complete set of xattrs
to be copied. If the flag is unset, only xattrs from the "user" namespace
are copied.
Fixes #17178.
Diffstat (limited to 'src/shared/copy.h')
-rw-r--r-- | src/shared/copy.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shared/copy.h b/src/shared/copy.h index f8992843e4..a7b45b4fbf 100644 --- a/src/shared/copy.h +++ b/src/shared/copy.h @@ -23,6 +23,7 @@ typedef enum CopyFlags { COPY_FSYNC = 1 << 10, /* fsync() after we are done */ COPY_FSYNC_FULL = 1 << 11, /* fsync_full() after we are done */ COPY_SYNCFS = 1 << 12, /* syncfs() the *top-level* dir after we are done */ + COPY_ALL_XATTRS = 1 << 13, /* Preserve all xattrs when copying, not just those in the user namespace */ } CopyFlags; typedef int (*copy_progress_bytes_t)(uint64_t n_bytes, void *userdata); @@ -72,4 +73,4 @@ int copy_rights_with_fallback(int fdf, int fdt, const char *patht); static inline int copy_rights(int fdf, int fdt) { return copy_rights_with_fallback(fdf, fdt, NULL); /* no fallback */ } -int copy_xattr(int fdf, int fdt); +int copy_xattr(int fdf, int fdt, CopyFlags copy_flags); |