Fix the build for you mortal monousers.
Actually getlogin didn't belong to usergroup.c in the first place anyway. And definitely not to the kernel. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23391 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
586cf6aeba
commit
cf9e598dd0
@ -132,3 +132,28 @@ getpwuid_r(uid_t uid, struct passwd *passwd, char *buffer,
|
||||
*_result = passwd;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
char *getlogin()
|
||||
{
|
||||
struct passwd *pw;
|
||||
pw = getpwuid(getuid());
|
||||
if (pw)
|
||||
return pw->pw_name;
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
int getlogin_r(char *name, size_t nameSize)
|
||||
{
|
||||
struct passwd *pw;
|
||||
pw = getpwuid(getuid());
|
||||
if (pw && (nameSize > 32/*PW_MAX_NAME*/)) {
|
||||
memset(name, 0, nameSize);
|
||||
strlcpy(name, pw->pw_name, 32/*PW_MAX_NAME*/);
|
||||
return B_OK;
|
||||
}
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
|
@ -621,6 +621,30 @@ struct passwd *getpwnam(const char *name)
|
||||
}
|
||||
|
||||
|
||||
char *getlogin()
|
||||
{
|
||||
struct passwd *pw;
|
||||
pw = getpwuid(getuid());
|
||||
if (pw)
|
||||
return pw->pw_name;
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
int getlogin_r(char *name, size_t nameSize)
|
||||
{
|
||||
struct passwd *pw;
|
||||
pw = getpwuid(getuid());
|
||||
if (pw && (nameSize > 32/*PW_MAX_NAME*/)) {
|
||||
memset(name, 0, nameSize);
|
||||
strlcpy(name, pw->pw_name, 32/*PW_MAX_NAME*/);
|
||||
return B_OK;
|
||||
}
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
void __init_pwd_stuff(void)
|
||||
//void _multiuser_init(void)
|
||||
{
|
||||
|
@ -100,28 +100,3 @@ seteuid(uid_t uid)
|
||||
return EPERM;
|
||||
}
|
||||
|
||||
|
||||
char *getlogin()
|
||||
{
|
||||
struct passwd *pw;
|
||||
pw = getpwuid(getuid());
|
||||
if (pw)
|
||||
return pw->pw_name;
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
int getlogin_r(char *name, size_t nameSize)
|
||||
{
|
||||
struct passwd *pw;
|
||||
pw = getpwuid(getuid());
|
||||
if (pw && (nameSize > 32/*PW_MAX_NAME*/)) {
|
||||
memset(name, 0, nameSize);
|
||||
strlcpy(name, pw->pw_name, 32/*PW_MAX_NAME*/);
|
||||
return B_OK;
|
||||
}
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user