Fix ret undefined error in nsh_telnetlogin when CONFIG_NSH_LOGIN_PLATFORM enable
Change-Id: Ib1fa8ba6879a5b330201f1144a2e5827cc4b1d0a Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
72bbc27b0f
commit
c44f271195
@ -176,9 +176,6 @@ int nsh_telnetlogin(FAR struct console_stdio_s *pstate)
|
|||||||
{
|
{
|
||||||
char username[16];
|
char username[16];
|
||||||
char password[16];
|
char password[16];
|
||||||
#ifdef CONFIG_NSH_LOGIN_PASSWD
|
|
||||||
int ret;
|
|
||||||
#endif
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Present the NSH Telnet greeting */
|
/* Present the NSH Telnet greeting */
|
||||||
@ -219,13 +216,9 @@ int nsh_telnetlogin(FAR struct console_stdio_s *pstate)
|
|||||||
/* Verify the username and password */
|
/* Verify the username and password */
|
||||||
|
|
||||||
#if defined(CONFIG_NSH_LOGIN_PASSWD)
|
#if defined(CONFIG_NSH_LOGIN_PASSWD)
|
||||||
ret = passwd_verify(username, password);
|
if (PASSWORD_VERIFY_MATCH(passwd_verify(username, password)))
|
||||||
if (PASSWORD_VERIFY_MATCH(ret))
|
|
||||||
|
|
||||||
#elif defined(CONFIG_NSH_LOGIN_PLATFORM)
|
#elif defined(CONFIG_NSH_LOGIN_PLATFORM)
|
||||||
ret = platform_user_verify(username, password);
|
if (PASSWORD_VERIFY_MATCH(platform_user_verify(username, password)))
|
||||||
if (PASSWORD_VERIFY_MATCH(ret))
|
|
||||||
|
|
||||||
#elif defined(CONFIG_NSH_LOGIN_FIXED)
|
#elif defined(CONFIG_NSH_LOGIN_FIXED)
|
||||||
if (strcmp(password, CONFIG_NSH_LOGIN_PASSWORD) == 0 &&
|
if (strcmp(password, CONFIG_NSH_LOGIN_PASSWORD) == 0 &&
|
||||||
strcmp(username, CONFIG_NSH_LOGIN_USERNAME) == 0)
|
strcmp(username, CONFIG_NSH_LOGIN_USERNAME) == 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user