提交 77f4a925 编写于 作者: Q Qiheng Lin

init: session keyring move to SystemInit()

As some platforms don't have first stage init, move
KeyCtrlGetKeyringId() to SystemInit().
Signed-off-by: NQiheng Lin <linqiheng@huawei.com>
Change-Id: Ida2f422be564b6a6b1d26535cb982b7f85c49d33
上级 1cc79acb
......@@ -94,6 +94,10 @@ static int FdHolderSockInit(void)
void SystemInit(void)
{
SignalInit();
// Set up a session keyring that all processes will have access to.
KeyCtrlGetKeyringId(KEY_SPEC_SESSION_KEYRING, 1);
// umask call always succeeds and return the previous mask value which is not needed here
(void)umask(DEFAULT_UMASK_INIT);
MakeDirRecursive("/dev/unix/socket", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
......@@ -199,9 +203,6 @@ static void StartInitSecondStage(void)
// It will panic if close stdio before execv("/bin/sh", NULL)
CloseStdio();
// Set up a session keyring that all processes will have access to.
KeyCtrlGetKeyringId(KEY_SPEC_SESSION_KEYRING, 1);
#ifndef DISABLE_INIT_TWO_STAGES
INIT_LOGI("Start init second stage.");
SwitchRoot("/usr");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册