]>
Commit | Line | Data |
---|---|---|
d6c9574f | 1 | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ |
e51bc1a2 LP |
2 | |
3 | /*** | |
4 | This file is part of systemd. | |
5 | ||
6 | Copyright 2010 Lennart Poettering | |
7 | ||
8 | systemd is free software; you can redistribute it and/or modify it | |
5430f7f2 LP |
9 | under the terms of the GNU Lesser General Public License as published by |
10 | the Free Software Foundation; either version 2.1 of the License, or | |
e51bc1a2 LP |
11 | (at your option) any later version. |
12 | ||
13 | systemd is distributed in the hope that it will be useful, but | |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
5430f7f2 | 16 | Lesser General Public License for more details. |
e51bc1a2 | 17 | |
5430f7f2 | 18 | You should have received a copy of the GNU Lesser General Public License |
e51bc1a2 LP |
19 | along with systemd; If not, see <http://www.gnu.org/licenses/>. |
20 | ***/ | |
21 | ||
e51bc1a2 LP |
22 | #include "label.h" |
23 | #include "util.h" | |
b9c1bc28 ŁS |
24 | |
25 | int label_fix(const char *path, bool ignore_enoent, bool ignore_erofs) { | |
26 | int r = 0; | |
27 | ||
6baa7db0 | 28 | if (mac_selinux_use()) { |
cc56fafe | 29 | r = mac_selinux_fix(path, ignore_enoent, ignore_erofs); |
b9c1bc28 ŁS |
30 | if (r < 0) |
31 | return r; | |
32 | } | |
33 | ||
6baa7db0 | 34 | if (mac_smack_use()) { |
cc56fafe | 35 | r = mac_smack_relabel_in_dev(path); |
b9c1bc28 ŁS |
36 | if (r < 0) |
37 | return r; | |
38 | } | |
e51bc1a2 LP |
39 | |
40 | return r; | |
41 | } |