• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

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

system/corennnnn


Commit MetaInfo

修訂96f387e8c02bdfcd5ed53684b5563c208770f7ee (tree)
時間2016-07-19 00:58:42
作者Jeff Sharkey <jsharkey@goog...>
CommiterAndroid (Google) Code Review

Log Message

Merge "Only restorecon CE storage after unlocked." into nyc-mr1-dev

Change Summary

差異

--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -875,8 +875,12 @@ static int do_restorecon_recursive(const std::vector<std::string>& args) {
875875 int ret = 0;
876876
877877 for (auto it = std::next(args.begin()); it != args.end(); ++it) {
878- if (restorecon_recursive(it->c_str()) < 0)
878+ /* The contents of CE paths are encrypted on FBE devices until user
879+ * credentials are presented (filenames inside are mangled), so we need
880+ * to delay restorecon of those until vold explicitly requests it. */
881+ if (restorecon_recursive_skipce(it->c_str()) < 0) {
879882 ret = -errno;
883+ }
880884 }
881885 return ret;
882886 }
--- a/init/util.cpp
+++ b/init/util.cpp
@@ -471,6 +471,12 @@ int restorecon_recursive(const char* pathname)
471471 return selinux_android_restorecon(pathname, SELINUX_ANDROID_RESTORECON_RECURSE);
472472 }
473473
474+int restorecon_recursive_skipce(const char* pathname)
475+{
476+ return selinux_android_restorecon(pathname,
477+ SELINUX_ANDROID_RESTORECON_RECURSE | SELINUX_ANDROID_RESTORECON_SKIPCE);
478+}
479+
474480 /*
475481 * Writes hex_len hex characters (1/2 byte) to hex from bytes.
476482 */
--- a/init/util.h
+++ b/init/util.h
@@ -63,6 +63,7 @@ void import_kernel_cmdline(bool in_qemu,
6363 int make_dir(const char *path, mode_t mode);
6464 int restorecon(const char *pathname);
6565 int restorecon_recursive(const char *pathname);
66+int restorecon_recursive_skipce(const char *pathname);
6667 std::string bytes_to_hex(const uint8_t *bytes, size_t bytes_len);
6768 bool is_dir(const char* pathname);
6869 bool expand_props(const std::string& src, std::string* dst);