frameworks/base
修订版 | 7a9c884f482fed0a105a61e61c4881dfd5657985 (tree) |
---|---|
时间 | 2016-11-18 04:32:17 |
作者 | Luca Stefani <luca.stefani.ge1@gmai...> |
Commiter | Gerrit Code Review |
zygote: Allow device to append extra whitelisted paths
Change-Id: Ic5b056d7ead520da8648db9be28e16a81ec27c73
@@ -0,0 +1,29 @@ | ||
1 | +/* | |
2 | + * Copyright (C) 2016 The CyanogenMod Project | |
3 | + * | |
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | + * you may not use this file except in compliance with the License. | |
6 | + * You may obtain a copy of the License at | |
7 | + * | |
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | + * | |
10 | + * Unless required by applicable law or agreed to in writing, software | |
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | + * See the License for the specific language governing permissions and | |
14 | + * limitations under the License. | |
15 | + */ | |
16 | + | |
17 | +/* | |
18 | +#define PATH_WHITELIST_EXTRA_H \ | |
19 | + "/proc/apid", \ | |
20 | + "/proc/aprf", | |
21 | +*/ | |
22 | + | |
23 | +// Overload this file in your device specific config if you need | |
24 | +// to add extra whitelisted paths. | |
25 | +// WARNING: Only use this if necessary. Custom inits should be | |
26 | +// checked for leaked file descriptors before even considering | |
27 | +// this. | |
28 | +// In order to add your files, copy the whole file (don't forget the copyright notice!), | |
29 | +// uncomment the #define above and change the paths inside to match your requirements | |
\ No newline at end of file |
@@ -35,6 +35,8 @@ | ||
35 | 35 | #include "JNIHelp.h" |
36 | 36 | #include "ScopedPrimitiveArray.h" |
37 | 37 | |
38 | +#include <fd_utils-inl-extra.h> | |
39 | + | |
38 | 40 | // Whitelist of open paths that the zygote is allowed to keep open. |
39 | 41 | // |
40 | 42 | // In addition to the paths listed here, all files ending with |
@@ -58,7 +60,10 @@ static const char* kPathWhitelist[] = { | ||
58 | 60 | "/dev/ion", |
59 | 61 | "@netlink@", |
60 | 62 | "/system/framework/org.cyanogenmod.platform-res.apk", |
61 | - "/proc/ged" | |
63 | + "/proc/ged", | |
64 | +#ifdef PATH_WHITELIST_EXTRA_H | |
65 | +PATH_WHITELIST_EXTRA_H | |
66 | +#endif | |
62 | 67 | }; |
63 | 68 | |
64 | 69 | static const char* kFdPath = "/proc/self/fd"; |