#include "util.h"
int label_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
- int r = 0;
+ int r, q;
- if (use_selinux()) {
- r = label_fix_selinux(path, ignore_enoent, ignore_erofs);
- if (r < 0)
- return r;
- }
+ r = mac_selinux_fix(path, ignore_enoent, ignore_erofs);
+ q = mac_smack_fix(path, ignore_enoent, ignore_erofs);
- if (use_smack()) {
- r = smack_relabel_in_dev(path);
- if (r < 0)
- return r;
- }
+ if (r < 0)
+ return r;
+ if (q < 0)
+ return q;
- return r;
+ return 0;
}