* syscalls.c (seteuid32): Do not return an error when the token cannot be

created only because of a problem with the gid.
This commit is contained in:
Christopher Faylor 2002-07-01 23:42:05 +00:00
parent a8983b39f5
commit 96edd0a9da
4 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2002-07-01 Pierre Humblet <pierre.humblet@ieee.org>
* syscalls.c (seteuid32): Do not return an error when the token cannot
be created only because of a problem with the gid.
2002-07-01 Christopher Faylor <cgf@redhat.com>
* fhandler_clipboard.c (fhandler_dev_clipboard::open): Force text mode.

View File

@ -135,7 +135,7 @@ geterrno_from_win_error (DWORD code, int deferrno)
void __stdcall
seterrno_from_win_error (const char *file, int line, DWORD code)
{
syscall_printf ("%s:%d errno %d", file, line, code);
syscall_printf ("%s:%d windows error %d", file, line, code);
set_errno (geterrno_from_win_error (code, EACCES));
return;
}

View File

@ -390,7 +390,7 @@ out:
if (hToken)
CloseHandle (hToken);
syscall_printf ("%d = set_process_privilege (%s, %d)",ret, privilege, enable);
syscall_printf ("%d = set_process_privilege (%s, %d)", ret, privilege, enable);
return ret;
}

View File

@ -2054,7 +2054,8 @@ seteuid32 (__uid32_t uid)
/* create_token failed. Try subauthentication. */
debug_printf ("create token failed, try subauthentication.");
cygheap->user.token = subauth (pw_new);
if (cygheap->user.token == INVALID_HANDLE_VALUE) goto failed;
if (cygheap->user.token == INVALID_HANDLE_VALUE)
goto failed;
}
}
@ -2098,6 +2099,11 @@ seteuid32 (__uid32_t uid)
return 0;
failed:
if (uid == myself->uid)
{
system_printf ("special case, returning 0");
return 0;
}
cygheap->user.token = sav_token;
cygheap->user.impersonated = sav_impersonated;
if (cygheap->user.issetuid ()