* Makefile.in (DLL_IMPORTS): Remove libadvapi32.a.

* autoload.cc: Add all advapi32 entry points.
	* mount.cc (mount_info::init): Read user fstab only if we have a
	username.
	* passwd.cc (pwdgrp::read_passwd): Only use username if we have one.
	* shared.cc (user_info::initialize): Set cb last so as not to override
	planned behaviour in pwdgrp::read_passwd.
	* uinfo.cc (cygheap_user::init): Fetch Windows username from environment
	variable $USERNAME.  Don't set name in cygheap if variable is empty.
	(internal_getlogin): If we still have no username, try GetUserNameW.
This commit is contained in:
Corinna Vinschen
2010-09-28 14:40:18 +00:00
parent 91e0b943a0
commit 2f1f8815c0
7 changed files with 122 additions and 15 deletions

View File

@@ -312,7 +312,6 @@ user_info::initialize ()
spinlock sversion (version, CURR_USER_MAGIC);
if (!sversion)
{
cb = sizeof (*user_shared);
cygpsid sid (cygheap->user.sid ());
struct passwd *pw = internal_getpwsid (sid);
/* Correct the user name with what's defined in /etc/passwd before
@@ -320,6 +319,7 @@ user_info::initialize ()
if (pw)
cygheap->user.set_name (pw->pw_name);
mountinfo.init (); /* Initialize the mount table. */
cb = sizeof (*user_shared);
}
else if (sversion != CURR_USER_MAGIC)
sversion.multiple_cygwin_problem ("user shared memory version", version,