copy: add flag COPY_MAC_CREATE to create with correct label

Useful for MAC aware file creation like in systemd-tmpfiles.
This commit is contained in:
Christian Göttsche
2019-11-28 12:17:56 +01:00
parent d2a56598d0
commit aeec5efab5
2 changed files with 59 additions and 2 deletions
+1
View File
@@ -16,6 +16,7 @@ typedef enum CopyFlags {
COPY_MERGE_EMPTY = 1 << 4, /* Merge an existing, empty directory with our new tree to copy */
COPY_CRTIME = 1 << 5, /* Generate a user.crtime_usec xattr off the source crtime if there is one, on copying */
COPY_SIGINT = 1 << 6, /* Check for SIGINT regularly and return EINTR if seen (caller needs to block SIGINT) */
COPY_MAC_CREATE = 1 << 7, /* Create files with the correct MAC label (currently SELinux only) */
} CopyFlags;
typedef int (*copy_progress_bytes_t)(uint64_t n_bytes, void *userdata);