| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "shared-forward.h" |
| 5 |
|
| 6 |
#include "../basic/label-util.h" /* IWYU pragma: export */ |
| 7 |
|
| 8 |
typedef enum LabelFixFlags { |
| 9 |
LABEL_IGNORE_ENOENT = 1 << 0, |
| 10 |
LABEL_IGNORE_EROFS = 1 << 1, |
| 11 |
} LabelFixFlags; |
| 12 |
|
| 13 |
int label_fix_full(int atfd, const char *inode_path, const char *label_path, LabelFixFlags flags); |
| 14 |
|
| 15 |
static inline int label_fix(const char *path, LabelFixFlags flags) { |
| 16 |
return label_fix_full(AT_FDCWD, path, path, flags); |
| 17 |
} |
| 18 |
|
| 19 |
int symlink_label(const char *old_path, const char *new_path); |
| 20 |
|
| 21 |
int mknodat_label(int dirfd, const char *pathname, mode_t mode, dev_t dev); |
| 22 |
static inline int mknod_label(const char *pathname, mode_t mode, dev_t dev) { |
| 23 |
return mknodat_label(AT_FDCWD, pathname, mode, dev); |
| 24 |
} |
| 25 |
|
| 26 |
int btrfs_subvol_make_label(const char *path); |
| 27 |
|
| 28 |
int mac_init(void); |
| 29 |
int mac_init_lazy(void); |