]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/label.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
7 #include "btrfs-util.h"
10 #include "selinux-util.h"
11 #include "smack-util.h"
13 int label_fix(const char *path
, LabelFixFlags flags
) {
16 r
= mac_selinux_fix(path
, flags
);
17 q
= mac_smack_fix(path
, flags
);
27 int symlink_label(const char *old_path
, const char *new_path
) {
33 r
= mac_selinux_create_file_prepare(new_path
, S_IFLNK
);
37 if (symlink(old_path
, new_path
) < 0)
40 mac_selinux_create_file_clear();
45 return mac_smack_fix(new_path
, 0);
48 int btrfs_subvol_make_label(const char *path
) {
53 r
= mac_selinux_create_file_prepare(path
, S_IFDIR
);
57 r
= btrfs_subvol_make(path
);
58 mac_selinux_create_file_clear();
63 return mac_smack_fix(path
, 0);