提交 e90c8265 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #835 from armink/fix_finsh_auth

[Finsh] Fix finsh password auth not valid when RT_DEBUG is not define
...@@ -214,6 +214,9 @@ static void finsh_wait_auth(void) ...@@ -214,6 +214,9 @@ static void finsh_wait_auth(void)
rt_bool_t input_finish = RT_FALSE; rt_bool_t input_finish = RT_FALSE;
char password[FINSH_PASSWORD_MAX] = { 0 }; char password[FINSH_PASSWORD_MAX] = { 0 };
rt_size_t cur_pos = 0; rt_size_t cur_pos = 0;
/* password not set */
if (rt_strlen(finsh_get_password()) == 0) return;
while (1) while (1)
{ {
rt_kprintf("Password for finsh: "); rt_kprintf("Password for finsh: ");
...@@ -410,7 +413,12 @@ void finsh_thread_entry(void *parameter) ...@@ -410,7 +413,12 @@ void finsh_thread_entry(void *parameter)
#ifdef FINSH_USING_AUTH #ifdef FINSH_USING_AUTH
/* set the default password when the password isn't setting */ /* set the default password when the password isn't setting */
if (rt_strlen(finsh_get_password()) == 0) if (rt_strlen(finsh_get_password()) == 0)
RT_ASSERT(finsh_set_password(FINSH_DEFAULT_PASSWORD) == RT_EOK); {
if (finsh_set_password(FINSH_DEFAULT_PASSWORD) != RT_EOK)
{
rt_kprintf("Finsh password set failed.\n");
}
}
/* waiting authenticate success */ /* waiting authenticate success */
finsh_wait_auth(); finsh_wait_auth();
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册