Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2000-06-17 15:34:33 +0400
committerCorinna Vinschen <corinna@vinschen.de>2000-06-17 15:34:33 +0400
commit9bbb81a443ee811bf2e7435347dd412fbeaf2f2a (patch)
tree6d87292881e2a4ccc075ffc5930c4f823881e06a /winsup
parente962f3c5f791ce9d66594073b4e84d8379693db7 (diff)
* pinfo.cc (pinfo_init): Add missing initializers.
* uinfo.cc (internal_getlogin): Request domain infos only when ntsec is ON.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/pinfo.cc2
-rw-r--r--winsup/cygwin/uinfo.cc51
3 files changed, 32 insertions, 29 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 202db4d39..ea1456f38 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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>
* 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
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_set_impersonation_token'.
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index d6ab35aa8..95588c4cd 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -99,6 +99,8 @@ pinfo_init (LPBYTE info)
myself->ppid = myself->pgid = myself->sid = myself->pid;
myself->ctty = -1;
myself->uid = USHRT_MAX;
+ myself->logsrv[0] = '\0';
+ myself->domain[0] = '\0';
environ_init (0); /* call after myself has been set up */
}
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index b50f155a2..4e4a0c459 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -27,15 +27,14 @@ char *
internal_getlogin (struct pinfo *pi)
{
DWORD username_len = MAX_USER_NAME;
- LPWKSTA_USER_INFO_1 ui = NULL;
if (! pi)
api_fatal ("pinfo pointer is NULL!\n");
if (os_being_run == winNT)
{
- int ret = NetWkstaUserGetInfo (NULL, 1, (LPBYTE *)&ui);
- if (! ret)
+ LPWKSTA_USER_INFO_1 ui;
+ if (allow_ntsec && !NetWkstaUserGetInfo (NULL, 1, (LPBYTE *)&ui))
{
wcstombs (pi->domain,
ui->wkui1_logon_domain,
@@ -56,7 +55,7 @@ internal_getlogin (struct pinfo *pi)
(wcslen (logon_srv) + 1) * sizeof (WCHAR));
if (logon_srv)
NetApiBufferFree (logon_srv);
- debug_printf ("AnyDC Server: %s", pi->logsrv);
+ debug_printf ("DC Server: %s", pi->logsrv);
}
else
debug_printf ("Logon Server: %s", pi->logsrv);
@@ -66,32 +65,28 @@ internal_getlogin (struct pinfo *pi)
debug_printf ("Windows Username: %s", pi->username);
NetApiBufferFree (ui);
}
- else
+ else if (! GetUserName (pi->username, &username_len))
+ strcpy (pi->username, "unknown");
+ if (!lookup_name (pi->username, pi->logsrv, pi->psid))
+ {
+ debug_printf ("myself->psid = NULL");
+ pi->psid = NULL;
+ }
+ else if (allow_ntsec)
{
- debug_printf ("%d = NetWkstaUserGetInfo ()\n", ret);
- if (! GetUserName (pi->username, &username_len))
- strcpy (pi->username, "unknown");
+ extern BOOL get_pw_sid (PSID, struct passwd*);
+ struct passwd *pw;
+ char psidbuf[40];
+ PSID psid = (PSID) psidbuf;
+
+ while ((pw = getpwent ()) != NULL)
+ if (get_pw_sid (psid, pw) && EqualSid (pi->psid, psid))
+ {
+ strcpy (pi->username, pw->pw_name);
+ break;
+ }
+ endpwent ();
}
- if (!lookup_name (pi->username, pi->logsrv, pi->psid))
- {
- debug_printf ("myself->psid = NULL");
- pi->psid = NULL;
- }
- else if (allow_ntsec)
- {
- extern BOOL get_pw_sid (PSID, struct passwd*);
- struct passwd *pw;
- char psidbuf[40];
- PSID psid = (PSID) psidbuf;
-
- while ((pw = getpwent ()) != NULL)
- if (get_pw_sid (psid, pw) && EqualSid (pi->psid, psid))
- {
- strcpy (pi->username, pw->pw_name);
- break;
- }
- endpwent ();
- }
}
else
{