Set capabilities sooner.
(cherry-pick from gingerbread I4e34b60c0a01b85ce0d80eb96ff3510604a68c71) Bug 3176774 Change-Id: I34d36b5b215ff0465f4f2f148c675f37ceba1a78
This commit is contained in:
@@ -680,19 +680,6 @@ class ZygoteConnection {
|
|||||||
FileDescriptor[] descriptors, PrintStream newStderr)
|
FileDescriptor[] descriptors, PrintStream newStderr)
|
||||||
throws ZygoteInit.MethodAndArgsCaller {
|
throws ZygoteInit.MethodAndArgsCaller {
|
||||||
|
|
||||||
/*
|
|
||||||
* First, set the capabilities if necessary
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (parsedArgs.uid != 0) {
|
|
||||||
try {
|
|
||||||
ZygoteInit.setCapabilities(parsedArgs.permittedCapabilities,
|
|
||||||
parsedArgs.effectiveCapabilities);
|
|
||||||
} catch (IOException ex) {
|
|
||||||
Log.e(TAG, "Error setting capabilities", ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Close the socket, unless we're in "peer wait" mode, in which
|
* Close the socket, unless we're in "peer wait" mode, in which
|
||||||
* case it's used to track the liveness of this process.
|
* case it's used to track the liveness of this process.
|
||||||
|
|||||||
@@ -508,18 +508,6 @@ public class ZygoteInit {
|
|||||||
private static void handleSystemServerProcess(
|
private static void handleSystemServerProcess(
|
||||||
ZygoteConnection.Arguments parsedArgs)
|
ZygoteConnection.Arguments parsedArgs)
|
||||||
throws ZygoteInit.MethodAndArgsCaller {
|
throws ZygoteInit.MethodAndArgsCaller {
|
||||||
/*
|
|
||||||
* First, set the capabilities if necessary
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (parsedArgs.uid != 0) {
|
|
||||||
try {
|
|
||||||
setCapabilities(parsedArgs.permittedCapabilities,
|
|
||||||
parsedArgs.effectiveCapabilities);
|
|
||||||
} catch (IOException ex) {
|
|
||||||
Log.e(TAG, "Error setting capabilities", ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
closeServerSocket();
|
closeServerSocket();
|
||||||
|
|
||||||
@@ -565,7 +553,9 @@ public class ZygoteInit {
|
|||||||
/* Request to fork the system server process */
|
/* Request to fork the system server process */
|
||||||
pid = Zygote.forkSystemServer(
|
pid = Zygote.forkSystemServer(
|
||||||
parsedArgs.uid, parsedArgs.gid,
|
parsedArgs.uid, parsedArgs.gid,
|
||||||
parsedArgs.gids, debugFlags, null);
|
parsedArgs.gids, debugFlags, null,
|
||||||
|
parsedArgs.permittedCapabilities,
|
||||||
|
parsedArgs.effectiveCapabilities);
|
||||||
} catch (IllegalArgumentException ex) {
|
} catch (IllegalArgumentException ex) {
|
||||||
throw new RuntimeException(ex);
|
throw new RuntimeException(ex);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user