* pinfo.cc (pinfo_init): Add missing initializers.
* uinfo.cc (internal_getlogin): Request domain infos only when ntsec is ON.
This commit is contained in:
parent
e962f3c5f7
commit
9bbb81a443
|
@ -1,3 +1,9 @@
|
||||||
|
Sat Jun 17 13:29:00 2000 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* pinfo.cc (pinfo_init): Add missing initializers.
|
||||||
|
* uinfo.cc (internal_getlogin): Request domain infos only
|
||||||
|
when ntsec is ON.
|
||||||
|
|
||||||
Fri Jun 16 19:27:27 2000 Christopher Faylor <cgf@cygnus.com>
|
Fri Jun 16 19:27:27 2000 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
* Makefile.in: Just use library files from this tree when building
|
* Makefile.in: Just use library files from this tree when building
|
||||||
|
@ -5,7 +11,7 @@ Fri Jun 16 19:27:27 2000 Christopher Faylor <cgf@cygnus.com>
|
||||||
* path.cc (chdir): Don't set cache to offending chdir. Change comment
|
* path.cc (chdir): Don't set cache to offending chdir. Change comment
|
||||||
to reflect current reality.
|
to reflect current reality.
|
||||||
|
|
||||||
Thu Jun 16 20:55:00 2000 Corinna Vinschen <corinna@vinschen.de>
|
Fri Jun 16 20:55:00 2000 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* cygwin.din: Define symbols for `cygwin_logon_user' and
|
* cygwin.din: Define symbols for `cygwin_logon_user' and
|
||||||
`cygwin_set_impersonation_token'.
|
`cygwin_set_impersonation_token'.
|
||||||
|
|
|
@ -99,6 +99,8 @@ pinfo_init (LPBYTE info)
|
||||||
myself->ppid = myself->pgid = myself->sid = myself->pid;
|
myself->ppid = myself->pgid = myself->sid = myself->pid;
|
||||||
myself->ctty = -1;
|
myself->ctty = -1;
|
||||||
myself->uid = USHRT_MAX;
|
myself->uid = USHRT_MAX;
|
||||||
|
myself->logsrv[0] = '\0';
|
||||||
|
myself->domain[0] = '\0';
|
||||||
|
|
||||||
environ_init (0); /* call after myself has been set up */
|
environ_init (0); /* call after myself has been set up */
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,15 +27,14 @@ char *
|
||||||
internal_getlogin (struct pinfo *pi)
|
internal_getlogin (struct pinfo *pi)
|
||||||
{
|
{
|
||||||
DWORD username_len = MAX_USER_NAME;
|
DWORD username_len = MAX_USER_NAME;
|
||||||
LPWKSTA_USER_INFO_1 ui = NULL;
|
|
||||||
|
|
||||||
if (! pi)
|
if (! pi)
|
||||||
api_fatal ("pinfo pointer is NULL!\n");
|
api_fatal ("pinfo pointer is NULL!\n");
|
||||||
|
|
||||||
if (os_being_run == winNT)
|
if (os_being_run == winNT)
|
||||||
{
|
{
|
||||||
int ret = NetWkstaUserGetInfo (NULL, 1, (LPBYTE *)&ui);
|
LPWKSTA_USER_INFO_1 ui;
|
||||||
if (! ret)
|
if (allow_ntsec && !NetWkstaUserGetInfo (NULL, 1, (LPBYTE *)&ui))
|
||||||
{
|
{
|
||||||
wcstombs (pi->domain,
|
wcstombs (pi->domain,
|
||||||
ui->wkui1_logon_domain,
|
ui->wkui1_logon_domain,
|
||||||
|
@ -56,7 +55,7 @@ internal_getlogin (struct pinfo *pi)
|
||||||
(wcslen (logon_srv) + 1) * sizeof (WCHAR));
|
(wcslen (logon_srv) + 1) * sizeof (WCHAR));
|
||||||
if (logon_srv)
|
if (logon_srv)
|
||||||
NetApiBufferFree (logon_srv);
|
NetApiBufferFree (logon_srv);
|
||||||
debug_printf ("AnyDC Server: %s", pi->logsrv);
|
debug_printf ("DC Server: %s", pi->logsrv);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
debug_printf ("Logon Server: %s", pi->logsrv);
|
debug_printf ("Logon Server: %s", pi->logsrv);
|
||||||
|
@ -66,12 +65,8 @@ internal_getlogin (struct pinfo *pi)
|
||||||
debug_printf ("Windows Username: %s", pi->username);
|
debug_printf ("Windows Username: %s", pi->username);
|
||||||
NetApiBufferFree (ui);
|
NetApiBufferFree (ui);
|
||||||
}
|
}
|
||||||
else
|
else if (! GetUserName (pi->username, &username_len))
|
||||||
{
|
|
||||||
debug_printf ("%d = NetWkstaUserGetInfo ()\n", ret);
|
|
||||||
if (! GetUserName (pi->username, &username_len))
|
|
||||||
strcpy (pi->username, "unknown");
|
strcpy (pi->username, "unknown");
|
||||||
}
|
|
||||||
if (!lookup_name (pi->username, pi->logsrv, pi->psid))
|
if (!lookup_name (pi->username, pi->logsrv, pi->psid))
|
||||||
{
|
{
|
||||||
debug_printf ("myself->psid = NULL");
|
debug_printf ("myself->psid = NULL");
|
||||||
|
|
Loading…
Reference in New Issue