Commit 910a36fd authored by topjohnwu's avatar topjohnwu

Make sepolicy.rules relative if possible

parent 8331206a
...@@ -202,7 +202,15 @@ persist: ...@@ -202,7 +202,15 @@ persist:
success: success:
// Create symlinks so we don't need to go through this logic again // Create symlinks so we don't need to go through this logic again
strcpy(p, "/sepolicy.rules"); strcpy(p, "/sepolicy.rules");
xsymlink(custom_rules_dir.data(), path); if (char *rel = strstr(custom_rules_dir.data(), MIRRDIR)) {
// Create symlink with relative path
char s[128];
s[0] = '.';
strlcpy(s + 1, rel + sizeof(MIRRDIR) - 1, sizeof(s) - 1);
xsymlink(s, path);
} else {
xsymlink(custom_rules_dir.data(), path);
}
} }
bool LegacySARInit::mount_system_root() { bool LegacySARInit::mount_system_root() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment