* uinfo.cc (cygheap_user::ontherange): Call NetUserGetInfo() only with

non-NULL logserver parameter.
This commit is contained in:
Corinna Vinschen 2002-06-19 13:56:34 +00:00
parent e1164b684d
commit 834224ab85
2 changed files with 24 additions and 23 deletions

View File

@ -1,3 +1,8 @@
2002-06-19 Corinna Vinschen <corinna@vinschen.de>
* uinfo.cc (cygheap_user::ontherange): Call NetUserGetInfo() only with
non-NULL logserver parameter.
2002-06-16 Christopher Faylor <cgf@redhat.com> 2002-06-16 Christopher Faylor <cgf@redhat.com>
* cygheap.h (cygheap_user::issetuid): New method. * cygheap.h (cygheap_user::issetuid): New method.

View File

@ -246,26 +246,21 @@ cygheap_user::ontherange (homebodies what, struct passwd *pw)
if (pw && pw->pw_dir && *pw->pw_dir) if (pw && pw->pw_dir && *pw->pw_dir)
cygwin_conv_to_full_win32_path (pw->pw_dir, homepath_env_buf); cygwin_conv_to_full_win32_path (pw->pw_dir, homepath_env_buf);
else else
{
sys_mbstowcs (wuser, name (), sizeof (wuser) / sizeof (*wuser));
if ((ret = NetUserGetInfo (NULL, wuser, 3, (LPBYTE *)&ui)))
{ {
if (env_logsrv ()) if (env_logsrv ())
{ {
WCHAR wlogsrv[INTERNET_MAX_HOST_NAME_LENGTH + 3]; WCHAR wlogsrv[INTERNET_MAX_HOST_NAME_LENGTH + 3];
strcpy (homepath_env_buf, env_logsrv ()); sys_mbstowcs (wlogsrv, env_logsrv (),
sys_mbstowcs (wlogsrv, homepath_env_buf,
sizeof (wlogsrv) / sizeof(*wlogsrv)); sizeof (wlogsrv) / sizeof(*wlogsrv));
ret = NetUserGetInfo (wlogsrv, wuser, 3,(LPBYTE *)&ui); sys_mbstowcs (wuser, name (), sizeof (wuser) / sizeof (*wuser));
} if (!(ret = NetUserGetInfo (wlogsrv, wuser, 3,(LPBYTE *)&ui)))
}
if (!ret)
{ {
char *p; char *p;
sys_wcstombs (homepath_env_buf, ui->usri3_home_dir, MAX_PATH); sys_wcstombs (homepath_env_buf, ui->usri3_home_dir, MAX_PATH);
if (!homepath_env_buf[0]) if (!homepath_env_buf[0])
{ {
sys_wcstombs (homepath_env_buf, ui->usri3_home_dir_drive, MAX_PATH); sys_wcstombs (homepath_env_buf, ui->usri3_home_dir_drive,
MAX_PATH);
if (homepath_env_buf[0]) if (homepath_env_buf[0])
strcat (homepath_env_buf, "\\"); strcat (homepath_env_buf, "\\");
else if (!GetSystemDirectory (homepath_env_buf, MAX_PATH)) else if (!GetSystemDirectory (homepath_env_buf, MAX_PATH))
@ -274,6 +269,7 @@ cygheap_user::ontherange (homebodies what, struct passwd *pw)
p[1] = '\0'; p[1] = '\0';
} }
} }
}
if (ui) if (ui)
NetApiBufferFree (ui); NetApiBufferFree (ui);
} }