summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2019-04-05 18:13:30 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-04-05 18:13:30 +0000
commit4ef3e8a309e8f889c78d7cfe06673c052e832ba7 (patch)
treecf9f396e0174b2df66f255288f023262a8a88e59
parentddb9bb211c06fddace52ac64bff91e9e9780df8c (diff)
parentd88acc95ab7b74979b123f0d4523bb2c4eec2880 (diff)
Merge "Don't set sehash when calling restoreconRecursive" into qt-dev
-rw-r--r--core/java/android/os/SELinux.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/os/SELinux.java b/core/java/android/os/SELinux.java
index f007dff0ab58..34809e76c91b 100644
--- a/core/java/android/os/SELinux.java
+++ b/core/java/android/os/SELinux.java
@@ -31,12 +31,15 @@ import java.io.IOException;
public class SELinux {
private static final String TAG = "SELinux";
- /** Keep in sync with ./external/libselinux/include/selinux/android.h */
+ /** Keep in sync with ./external/selinux/libselinux/include/selinux/android.h */
private static final int SELINUX_ANDROID_RESTORECON_NOCHANGE = 1;
private static final int SELINUX_ANDROID_RESTORECON_VERBOSE = 2;
private static final int SELINUX_ANDROID_RESTORECON_RECURSE = 4;
private static final int SELINUX_ANDROID_RESTORECON_FORCE = 8;
private static final int SELINUX_ANDROID_RESTORECON_DATADATA = 16;
+ private static final int SELINUX_ANDROID_RESTORECON_SKIPCE = 32;
+ private static final int SELINUX_ANDROID_RESTORECON_CROSS_FILESYSTEMS = 64;
+ private static final int SELINUX_ANDROID_RESTORECON_SKIP_SEHASH = 128;
/**
* Get context associated with path by file_contexts.
@@ -182,7 +185,8 @@ public class SELinux {
@UnsupportedAppUsage
public static boolean restoreconRecursive(File file) {
try {
- return native_restorecon(file.getCanonicalPath(), SELINUX_ANDROID_RESTORECON_RECURSE);
+ return native_restorecon(file.getCanonicalPath(),
+ SELINUX_ANDROID_RESTORECON_RECURSE | SELINUX_ANDROID_RESTORECON_SKIP_SEHASH);
} catch (IOException e) {
Slog.e(TAG, "Error getting canonical path. Restorecon failed for " +
file.getPath(), e);