mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Add pw_gecos to struct passwd.
This commit is contained in:
parent
ef32b3fcbe
commit
7fc085f469
2 changed files with 3 additions and 0 deletions
|
@ -40,6 +40,7 @@ struct passwd
|
|||
char pw_name[_PASSWD_BUFFER_SIZE];
|
||||
char pw_dir[_PASSWD_BUFFER_SIZE];
|
||||
char pw_shell[_PASSWD_BUFFER_SIZE];
|
||||
char pw_gecos[_PASSWD_BUFFER_SIZE];
|
||||
uid_t pw_uid;
|
||||
gid_t pw_gid;
|
||||
};
|
||||
|
|
|
@ -36,6 +36,7 @@ const char* const ROOT_GID = "0";
|
|||
const char* const ROOT_NAME = "root";
|
||||
const char* const ROOT_HOME = "/root";
|
||||
const char* const ROOT_SHELL = "sh";
|
||||
const char* const ROOT_FULLNAME = "root";
|
||||
|
||||
static struct passwd global_passwd;
|
||||
|
||||
|
@ -62,6 +63,7 @@ static struct passwd* fill_passwd(struct passwd* pw)
|
|||
strcpy(pw->pw_name, getenv_def("USERNAME", ROOT_NAME));
|
||||
strcpy(pw->pw_dir, getenv_def("HOME", ROOT_HOME));
|
||||
strcpy(pw->pw_shell, getenv_def("SHELL", ROOT_SHELL));
|
||||
strcpy(pw->pw_gecos, getenv_def("USERFULLNAME", ROOT_FULLNAME));
|
||||
pw->pw_uid = atoi(getenv_def("USERID", ROOT_UID));
|
||||
pw->pw_gid = atoi(getenv_def("GROUPID", ROOT_GID));
|
||||
return pw;
|
||||
|
|
Loading…
Reference in a new issue