* uinfo.cc (internal_getlogin): Add pointer check.
This commit is contained in:
parent
5d0cbc17db
commit
a8506a1917
|
@ -1,3 +1,7 @@
|
||||||
|
Mon Jul 9 10:43:00 2001 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* uinfo.cc (internal_getlogin): Add pointer check.
|
||||||
|
|
||||||
Mon Jul 9 10:05:00 2001 Corinna Vinschen <corinna@vinschen.de>
|
Mon Jul 9 10:05:00 2001 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* security.cc (alloc_sd): Don't set inheritance attribute for
|
* security.cc (alloc_sd): Don't set inheritance attribute for
|
||||||
|
|
|
@ -82,10 +82,14 @@ internal_getlogin (cygheap_user &user)
|
||||||
/* HOMEDRIVE and HOMEPATH are wrong most of the time, too,
|
/* HOMEDRIVE and HOMEPATH are wrong most of the time, too,
|
||||||
after changing user context! */
|
after changing user context! */
|
||||||
sys_mbstowcs (wuser, user.name (), UNLEN + 1);
|
sys_mbstowcs (wuser, user.name (), UNLEN + 1);
|
||||||
strcat (strcpy (buf, "\\\\"), user.logsrv ());
|
wlogsrv[0] = '\0';
|
||||||
sys_mbstowcs (wlogsrv, buf, INTERNET_MAX_HOST_NAME_LENGTH + 3);
|
if (user.logsrv ())
|
||||||
|
{
|
||||||
|
strcat (strcpy (buf, "\\\\"), user.logsrv ());
|
||||||
|
sys_mbstowcs (wlogsrv, buf, INTERNET_MAX_HOST_NAME_LENGTH + 3);
|
||||||
|
}
|
||||||
if (!NetUserGetInfo (NULL, wuser, 3, (LPBYTE *)&ui)
|
if (!NetUserGetInfo (NULL, wuser, 3, (LPBYTE *)&ui)
|
||||||
|| !NetUserGetInfo (wlogsrv, wuser, 3,(LPBYTE *)&ui))
|
|| (wlogsrv[0] && !NetUserGetInfo (wlogsrv, wuser, 3,(LPBYTE *)&ui)))
|
||||||
{
|
{
|
||||||
sys_wcstombs (buf, ui->usri3_home_dir, MAX_PATH);
|
sys_wcstombs (buf, ui->usri3_home_dir, MAX_PATH);
|
||||||
if (!buf[0])
|
if (!buf[0])
|
||||||
|
|
Loading…
Reference in New Issue