* commit '29c6f24b254b4ea1a7d8448980e736355e4badf6': restorecon /data/anr directory.
This commit is contained in:
committed by
Android Git Automerger
commit
2bd65b61ba
@@ -105,6 +105,7 @@ import android.os.ParcelFileDescriptor;
|
||||
import android.os.Process;
|
||||
import android.os.RemoteCallbackList;
|
||||
import android.os.RemoteException;
|
||||
import android.os.SELinux;
|
||||
import android.os.ServiceManager;
|
||||
import android.os.StrictMode;
|
||||
import android.os.SystemClock;
|
||||
@@ -3040,7 +3041,12 @@ public final class ActivityManagerService extends ActivityManagerNative
|
||||
File tracesFile = new File(tracesPath);
|
||||
try {
|
||||
File tracesDir = tracesFile.getParentFile();
|
||||
if (!tracesDir.exists()) tracesFile.mkdirs();
|
||||
if (!tracesDir.exists()) {
|
||||
tracesFile.mkdirs();
|
||||
if (!SELinux.restorecon(tracesDir)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
FileUtils.setPermissions(tracesDir.getPath(), 0775, -1, -1); // drwxrwxr-x
|
||||
|
||||
if (clearTraces && tracesFile.exists()) tracesFile.delete();
|
||||
@@ -3144,7 +3150,12 @@ public final class ActivityManagerService extends ActivityManagerNative
|
||||
final File tracesDir = tracesFile.getParentFile();
|
||||
final File tracesTmp = new File(tracesDir, "__tmp__");
|
||||
try {
|
||||
if (!tracesDir.exists()) tracesFile.mkdirs();
|
||||
if (!tracesDir.exists()) {
|
||||
tracesFile.mkdirs();
|
||||
if (!SELinux.restorecon(tracesDir.getPath())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
FileUtils.setPermissions(tracesDir.getPath(), 0775, -1, -1); // drwxrwxr-x
|
||||
|
||||
if (tracesFile.exists()) {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.server.am;
|
||||
|
||||
import android.os.SELinux;
|
||||
import android.util.Slog;
|
||||
|
||||
import java.io.*;
|
||||
@@ -80,6 +81,9 @@ class DeviceMonitor {
|
||||
if (!BASE.isDirectory() && !BASE.mkdirs()) {
|
||||
throw new AssertionError("Couldn't create " + BASE + ".");
|
||||
}
|
||||
if (!SELinux.restorecon(BASE)) {
|
||||
throw new AssertionError("Couldn't restorecon " + BASE + ".");
|
||||
}
|
||||
}
|
||||
|
||||
private static final File[] PATHS = {
|
||||
|
||||
Reference in New Issue
Block a user