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
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-07-02 03:42:05 +0400
committerChristopher Faylor <me@cgf.cx>2002-07-02 03:42:05 +0400
commit96edd0a9dabf6262ebb9ccf3c472c433921e2472 (patch)
treed3e9360d407e94f4ee356de6c0b398376a212ca9
parenta8983b39f59958fd819429de4854d42ab36c15a8 (diff)
* syscalls.c (seteuid32): Do not return an error when the token cannot be
created only because of a problem with the gid.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/errno.cc2
-rw-r--r--winsup/cygwin/sec_helper.cc2
-rw-r--r--winsup/cygwin/syscalls.cc8
4 files changed, 14 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 7049bcad4..6e8d3933f 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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.
diff --git a/winsup/cygwin/errno.cc b/winsup/cygwin/errno.cc
index 17ac6a61b..088f1a18d 100644
--- a/winsup/cygwin/errno.cc
+++ b/winsup/cygwin/errno.cc
@@ -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;
}
diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc
index 6aaf7f607..5c7eb26d2 100644
--- a/winsup/cygwin/sec_helper.cc
+++ b/winsup/cygwin/sec_helper.cc
@@ -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;
}
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 006a9b758..2b0bc82f1 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -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 ()