• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

frameworks/base


Commit MetaInfo

修订版7a9c884f482fed0a105a61e61c4881dfd5657985 (tree)
时间2016-11-18 04:32:17
作者Luca Stefani <luca.stefani.ge1@gmai...>
CommiterGerrit Code Review

Log Message

zygote: Allow device to append extra whitelisted paths

Change-Id: Ic5b056d7ead520da8648db9be28e16a81ec27c73

更改概述

差异

--- /dev/null
+++ b/core/jni/fd_utils-inl-extra.h
@@ -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
--- a/core/jni/fd_utils-inl.h
+++ b/core/jni/fd_utils-inl.h
@@ -35,6 +35,8 @@
3535 #include "JNIHelp.h"
3636 #include "ScopedPrimitiveArray.h"
3737
38+#include <fd_utils-inl-extra.h>
39+
3840 // Whitelist of open paths that the zygote is allowed to keep open.
3941 //
4042 // In addition to the paths listed here, all files ending with
@@ -58,7 +60,10 @@ static const char* kPathWhitelist[] = {
5860 "/dev/ion",
5961 "@netlink@",
6062 "/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
6267 };
6368
6469 static const char* kFdPath = "/proc/self/fd";