mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 10:58:49 +08:00
libc/pwd: Correct the geos related comment and ddd ROOT_GEOS macro
fix the minor issue in https://github.com/apache/nuttx/pull/7998 Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
a9c7381b59
commit
9d1b8f0966
6 changed files with 11 additions and 5 deletions
|
@ -133,13 +133,14 @@ static int pwd_foreach(pwd_foreach_match_t match, uintptr_t arg,
|
||||||
*
|
*
|
||||||
* The format of the password file is:
|
* The format of the password file is:
|
||||||
*
|
*
|
||||||
* user:x:uid:uid:home
|
* user:x:uid:uid:geos:home
|
||||||
*
|
*
|
||||||
* Where:
|
* Where:
|
||||||
* user: User name
|
* user: User name
|
||||||
* x: Encrypted password
|
* x: Encrypted password
|
||||||
* uid: User ID
|
* uid: User ID
|
||||||
* uid: Group ID
|
* uid: Group ID
|
||||||
|
* geos: User information
|
||||||
* home: Login directory
|
* home: Login directory
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ FAR struct passwd *getpwnam(FAR const char *name)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return getpwbuf(ROOT_UID, ROOT_GID, ROOT_NAME, ROOT_NAME, ROOT_DIR,
|
return getpwbuf(ROOT_UID, ROOT_GID, ROOT_NAME, ROOT_GEOCS, ROOT_DIR,
|
||||||
ROOT_SHELL);
|
ROOT_SHELL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ int getpwnam_r(FAR const char *name, FAR struct passwd *pwd, FAR char *buf,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return getpwbuf_r(ROOT_UID, ROOT_GID, ROOT_NAME, ROOT_NAME, ROOT_DIR,
|
return getpwbuf_r(ROOT_UID, ROOT_GID, ROOT_NAME, ROOT_GEOCS, ROOT_DIR,
|
||||||
ROOT_SHELL, pwd, buf, buflen, result);
|
ROOT_SHELL, pwd, buf, buflen, result);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ FAR struct passwd *getpwuid(uid_t uid)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return getpwbuf(ROOT_UID, ROOT_GID, ROOT_NAME, ROOT_NAME, ROOT_DIR,
|
return getpwbuf(ROOT_UID, ROOT_GID, ROOT_NAME, ROOT_GEOCS, ROOT_DIR,
|
||||||
ROOT_SHELL);
|
ROOT_SHELL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ int getpwuid_r(uid_t uid, FAR struct passwd *pwd, FAR char *buf,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return getpwbuf_r(ROOT_UID, ROOT_GID, ROOT_NAME, ROOT_NAME, ROOT_DIR,
|
return getpwbuf_r(ROOT_UID, ROOT_GID, ROOT_NAME, ROOT_GEOCS, ROOT_DIR,
|
||||||
ROOT_SHELL, pwd, buf, buflen, result);
|
ROOT_SHELL, pwd, buf, buflen, result);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,9 +33,14 @@
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef CONFIG_LIBC_PASSWD_LINESIZE
|
||||||
|
# define CONFIG_LIBC_PASSWD_LINESIZE 80
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ROOT_NAME "root"
|
#define ROOT_NAME "root"
|
||||||
#define ROOT_UID 0
|
#define ROOT_UID 0
|
||||||
#define ROOT_GID 0
|
#define ROOT_GID 0
|
||||||
|
#define ROOT_GEOCS "root"
|
||||||
#define ROOT_DIR "/root"
|
#define ROOT_DIR "/root"
|
||||||
#define ROOT_SHELL "/bin/nsh"
|
#define ROOT_SHELL "/bin/nsh"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue