Cccccczj commented on code in PR #13221:
URL: https://github.com/apache/nuttx/pull/13221#discussion_r1799005682


##########
libs/libc/pwd/lib_pwd.h:
##########
@@ -37,12 +38,14 @@
 #  define CONFIG_LIBC_PASSWD_LINESIZE 80
 #endif
 
-#define ROOT_NAME  "root"
-#define ROOT_UID   0
-#define ROOT_GID   0
-#define ROOT_GEOCS "root"
-#define ROOT_DIR   "/root"
-#define ROOT_SHELL "/bin/nsh"
+#define ROOT_NAME   "root"
+#define ROOT_UID    0
+#define ROOT_GID    0
+#define ROOT_GEOCS  "root"
+#define ROOT_DIR    "/root"
+#define ROOT_SHELL  "/bin/nsh"
+#define ROOT_PASSWD "root"
+#define ROOT_PWDP   "$1$123$SGj4CnC7VtiFx.tjjtazK1"

Review Comment:
   When CONFIG_LIBC_PASSWD_FILE is enabled, it will be obtained from 
/etc/passwd. If there is no /etc/passwd path, a fixed value will be used.
   #ifdef CONFIG_LIBC_PASSWD_FILE
     getspnam_r(name, &g_spwd, g_passwd_buffer,
                sizeof(g_passwd_buffer), &result);
   #else
     if (strcmp(name, ROOT_NAME) == 0)
       {
         size_t nsize = sizeof(ROOT_NAME);
         size_t psize = sizeof(ROOT_PWDP);
         result = &g_spwd;
   
         result->sp_namp = g_passwd_buffer;
         result->sp_pwdp = &g_passwd_buffer[nsize];
   
         strlcpy(result->sp_namp, ROOT_NAME, nsize);
         strlcpy(result->sp_pwdp, ROOT_PWDP, psize);
       }
   #endif



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to