mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-22 00:38:06 +08:00
* passwd.cc (read_etc_passwd): Never add an entry when starting
on Win95/98/ME if a default entry is present. * uinfo.cc (internal_getlogin): Look for the default uid if needed. Always call user.set_name ().
This commit is contained in:
parent
f1da8a0664
commit
efcaf0426a
@ -1,3 +1,10 @@
|
|||||||
|
2002-11-25 Pierre Humblet <pierre.humblet@ieee.org>
|
||||||
|
|
||||||
|
* passwd.cc (read_etc_passwd): Never add an entry when starting
|
||||||
|
on Win95/98/ME if a default entry is present.
|
||||||
|
* uinfo.cc (internal_getlogin): Look for the default uid if needed.
|
||||||
|
Always call user.set_name ().
|
||||||
|
|
||||||
2002-11-25 Corinna Vinschen <corinna@vinschen.de>
|
2002-11-25 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* sec_acl.cc (getacl): Set errno to ENOSPC if command is GETACL and
|
* sec_acl.cc (getacl): Set errno to ENOSPC if command is GETACL and
|
||||||
|
@ -198,6 +198,8 @@ read_etc_passwd ()
|
|||||||
&& (searchentry = !internal_getpwsid (tu)))
|
&& (searchentry = !internal_getpwsid (tu)))
|
||||||
default_uid = DEFAULT_UID_NT;
|
default_uid = DEFAULT_UID_NT;
|
||||||
}
|
}
|
||||||
|
else if (myself->uid == ILLEGAL_UID)
|
||||||
|
searchentry = !search_for (DEFAULT_UID, NULL);
|
||||||
if (searchentry &&
|
if (searchentry &&
|
||||||
(!(pw = search_for (0, cygheap->user.name ())) ||
|
(!(pw = search_for (0, cygheap->user.name ())) ||
|
||||||
(myself->uid != ILLEGAL_UID &&
|
(myself->uid != ILLEGAL_UID &&
|
||||||
|
@ -61,20 +61,21 @@ internal_getlogin (cygheap_user &user)
|
|||||||
from the Windows user name */
|
from the Windows user name */
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
if ((pw = internal_getpwsid (tu)))
|
pw = internal_getpwsid (tu);
|
||||||
user.set_name (pw->pw_name);
|
|
||||||
/* Set token owner to the same value as token user */
|
/* Set token owner to the same value as token user */
|
||||||
if (!SetTokenInformation (ptok, TokenOwner, &tu, sizeof tu))
|
if (!SetTokenInformation (ptok, TokenOwner, &tu, sizeof tu))
|
||||||
debug_printf ("SetTokenInformation(TokenOwner): %E");
|
debug_printf ("SetTokenInformation(TokenOwner): %E");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pw && !(pw = getpwnam (user.name ())))
|
if (!pw && !(pw = getpwnam (user.name ()))
|
||||||
debug_printf("user name not found in augmented /etc/passwd");
|
&& !(pw = getpwuid32 (DEFAULT_UID)))
|
||||||
|
debug_printf("user not found in augmented /etc/passwd");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
myself->uid = pw->pw_uid;
|
myself->uid = pw->pw_uid;
|
||||||
myself->gid = pw->pw_gid;
|
myself->gid = pw->pw_gid;
|
||||||
|
user.set_name (pw->pw_name);
|
||||||
if (wincap.has_security ())
|
if (wincap.has_security ())
|
||||||
{
|
{
|
||||||
cygsid gsid;
|
cygsid gsid;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user