/* Standard way to build a security descriptor with the usual DACL */
PSECURITY_ATTRIBUTES sa_buf = (PSECURITY_ATTRIBUTES) alloca (1024);
psd = (PSECURITY_DESCRIPTOR)
- (sec_user_nih (sa_buf, sid()))->lpSecurityDescriptor;
+ (sec_user_nih (sa_buf, sid()))->lpSecurityDescriptor;
BOOLEAN acl_exists, dummy;
TOKEN_DEFAULT_DACL dacl;
extern "C" int
getlogin_r (char *name, size_t namesize)
{
- char *login = getlogin ();
+ const char *login = cygheap->user.name ();
size_t len = strlen (login) + 1;
if (len > namesize)
return ERANGE;
extern "C" char *
getlogin (void)
{
- return strcpy (__getlogin_username, cygheap->user.name ());
+ static char username[UNLEN];
+ int ret = getlogin_r (username, UNLEN);
+ if (ret)
+ {
+ set_errno (ret);
+ return NULL;
+ }
+ return username;
}
extern "C" __uid32_t
if (!(ret = NetUserGetInfo (wlogsrv, wuser, 3, (LPBYTE *) &ui)))
{
sys_wcstombs (homepath_env_buf, NT_MAX_PATH,
- ui->usri3_home_dir);
+ ui->usri3_home_dir);
if (!homepath_env_buf[0])
{
sys_wcstombs (homepath_env_buf, NT_MAX_PATH,