Loading core/jni/android_os_SELinux.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -239,8 +239,12 @@ static jboolean setFileCon(JNIEnv *env, jobject, jstring pathStr, jstring contex char *tmp = const_cast<char *>(context.c_str()); int ret = setfilecon(path.c_str(), tmp); if (ret == 0) { ALOGV("setFileCon(%s, %s) => %d", path.c_str(), context.c_str(), ret); return (ret == 0) ? true : false; return true; } ALOGE("setFileCon(%s, %s) => %d, err: %s", path.c_str(), context.c_str(), ret, strerror(errno)); return false; } /* Loading services/core/java/com/android/server/pm/PackageInstallerService.java +10 −1 Original line number Diff line number Diff line Loading @@ -1034,9 +1034,18 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements } if (!SELinux.restorecon(stageDir)) { String path = stageDir.getCanonicalPath(); String ctx = SELinux.fileSelabelLookup(path); boolean success = SELinux.setFileContext(path, ctx); Slog.e(TAG, "Failed to SELinux.restorecon session dir, path: [" + path + "], ctx: [" + ctx + "]. Retrying via SELinux.fileSelabelLookup/SELinux.setFileContext: " + (success ? "SUCCESS" : "FAILURE")); if (!success) { throw new IOException("Failed to restorecon session dir: " + stageDir); } } } private String buildExternalStageCid(int sessionId) { return "smdl" + sessionId + ".tmp"; Loading Loading
core/jni/android_os_SELinux.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -239,8 +239,12 @@ static jboolean setFileCon(JNIEnv *env, jobject, jstring pathStr, jstring contex char *tmp = const_cast<char *>(context.c_str()); int ret = setfilecon(path.c_str(), tmp); if (ret == 0) { ALOGV("setFileCon(%s, %s) => %d", path.c_str(), context.c_str(), ret); return (ret == 0) ? true : false; return true; } ALOGE("setFileCon(%s, %s) => %d, err: %s", path.c_str(), context.c_str(), ret, strerror(errno)); return false; } /* Loading
services/core/java/com/android/server/pm/PackageInstallerService.java +10 −1 Original line number Diff line number Diff line Loading @@ -1034,9 +1034,18 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements } if (!SELinux.restorecon(stageDir)) { String path = stageDir.getCanonicalPath(); String ctx = SELinux.fileSelabelLookup(path); boolean success = SELinux.setFileContext(path, ctx); Slog.e(TAG, "Failed to SELinux.restorecon session dir, path: [" + path + "], ctx: [" + ctx + "]. Retrying via SELinux.fileSelabelLookup/SELinux.setFileContext: " + (success ? "SUCCESS" : "FAILURE")); if (!success) { throw new IOException("Failed to restorecon session dir: " + stageDir); } } } private String buildExternalStageCid(int sessionId) { return "smdl" + sessionId + ".tmp"; Loading