diff options
author | scottc <scottc> | 2002-06-15 23:39:46 +0000 |
---|---|---|
committer | scottc <scottc> | 2002-06-15 23:39:46 +0000 |
commit | 0987b427ccf762ff19dc4b1382d845dfbb9e627b (patch) | |
tree | 3128c53a6d68bd9e05a534278ed92181dc064568 /winsup/cygwin/cygserver_process.cc | |
parent | 1c4132e7b723a16c7893b2132557f1f95d8a57e5 (diff) | |
download | gdb-0987b427ccf762ff19dc4b1382d845dfbb9e627b.tar.gz |
* cygserver.cc (check_and_dup_handle): Only use security code if
running on NT, i.e. if wincap.has_security().
(client_request_attach_tty::serve): Add check for has_security().
* cygserver_process.cc (process_cache::process): Use DWORD winpid
throughout to avoid win32 vs. cygwin pid confusion.
(process::process): Ditto.
* cygserver_shm.cc (client_request_shm::serve): Only use security
code if running on NT, i.e. if wincap.has_security().
* cygserver_shm.h (client_request_shm::parameters.in): Replace the
ambiguous pid field with cygpid and winpid fields.
(client_request_shm::client_request_shm): Reduce to only two
client-side constructors: one for SHM_CREATE, another for all the
other requests.
* shm.cc (client_request_shm::client_request_shm):
Ditto. Initialize cygpid and winpid fields here. On NT initialize
sd_buf here using set_security_attribute() to make use of the euid
and egid.
(shmat): Use new client_request_shm constructor.
(shmdt): Ditto.
(shmctl): Ditto.
(shmget): Ditto. Remove security code, now performed in the
relevant client_request_shm constructor.
* include/cygwin/cygserver_process.h: (class cleanup_routine):
Change winpid type to DWORD.
(class process): Ditto.
Diffstat (limited to 'winsup/cygwin/cygserver_process.cc')
-rwxr-xr-x | winsup/cygwin/cygserver_process.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/winsup/cygwin/cygserver_process.cc b/winsup/cygwin/cygserver_process.cc index 6eef702b67d..94529b85112 100755 --- a/winsup/cygwin/cygserver_process.cc +++ b/winsup/cygwin/cygserver_process.cc @@ -47,25 +47,25 @@ process_cache::~process_cache () } class process * -process_cache::process (long pid) +process_cache::process (DWORD winpid) { class process *entry = head; /* TODO: make this more granular, so a search doesn't involve the write lock */ EnterCriticalSection (&cache_write_access); if (!entry) { - entry = new class process (pid); + entry = new class process (winpid); entry->next = (class process *) InterlockedExchangePointer (&head, entry); PulseEvent (cache_add_trigger); } else { - while (entry->winpid != pid && entry->next) + while (entry->winpid != winpid && entry->next) entry = entry->next; - if (entry->winpid != pid) + if (entry->winpid != winpid) { - class process *new_entry = new class process (pid); + class process *new_entry = new class process (winpid); new_entry->next = (class process *) InterlockedExchangePointer (&entry->next, new_entry); @@ -187,18 +187,18 @@ do_process_init (void) /* we don't have a cache shutdown capability today */ } -process::process (long pid): -winpid (pid), next (NULL), cleaning_up (0), head (NULL), _exit_status (STILL_ACTIVE) +process::process (DWORD winpid): +winpid (winpid), next (NULL), cleaning_up (0), head (NULL), _exit_status (STILL_ACTIVE) { pthread_once (&process_init, do_process_init); EnterCriticalSection (&process_access); - thehandle = OpenProcess (PROCESS_ALL_ACCESS, FALSE, pid); + thehandle = OpenProcess (PROCESS_ALL_ACCESS, FALSE, winpid); if (!thehandle) { - system_printf ("unable to obtain handle for new cache process %ld", pid); + system_printf ("unable to obtain handle for new cache process %lu", winpid); thehandle = INVALID_HANDLE_VALUE; } - debug_printf ("Got handle %p for new cache process %ld", thehandle, pid); + debug_printf ("Got handle %p for new cache process %lu", thehandle, winpid); InitializeCriticalSection (&access); LeaveCriticalSection (&process_access); } |