From: Christopher Faylor Date: Sun, 28 Sep 2003 15:46:00 +0000 (+0000) Subject: * sigproc.cc (proc_subproc): Restrict permissions on ppid_handle. X-Git-Tag: corinna-01~149 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=e6ba8355139d41af875894f1adb2156352d617f3;p=newlib-cygwin.git * sigproc.cc (proc_subproc): Restrict permissions on ppid_handle. * devices.shilka (device::parse): Restore check for tty in unit handling, but without the previous typo. * devices.cc: Regenerate. * devices.h (DEV_CYGDRIVE_MAJOR): Change major number to one used by linux for "user-mode virtual block device". --- diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 83c19a2ed..7618b5149 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,15 @@ +2003-09-28 Pierre Humblet + + * sigproc.cc (proc_subproc): Restrict permissions on ppid_handle. + +2003-09-28 Christopher Faylor + + * devices.shilka (device::parse): Restore check for tty in unit + handling, but without the previous typo. + * devices.cc: Regenerate. + * devices.h (DEV_CYGDRIVE_MAJOR): Change major number to one used by + linux for "user-mode virtual block device". + 2003-09-28 Corinna Vinschen * devices.h: Move a few device major numbers. Fix typo of FH_UDP. diff --git a/winsup/cygwin/devices.cc b/winsup/cygwin/devices.cc index 0131b3160..ce2176ec7 100644 --- a/winsup/cygwin/devices.cc +++ b/winsup/cygwin/devices.cc @@ -1195,7 +1195,7 @@ device::parse (const char *s) if (++len < prior_len) { dev = KR_find_keyword (s, len); - if (!dev || (!dev->upper && !dev->devn == FH_TTY)) + if (!dev || (!dev->upper && dev->devn != FH_TTY)) dev = NULL; else { diff --git a/winsup/cygwin/devices.h b/winsup/cygwin/devices.h index 7e7cc92df..d133c8fa5 100644 --- a/winsup/cygwin/devices.h +++ b/winsup/cygwin/devices.h @@ -100,7 +100,7 @@ enum fh_devices FH_URANDOM = FHDEV (1, 9), FH_OSS_DSP = FHDEV (14, 3), - DEV_CYGDRIVE_MAJOR = 29, + DEV_CYGDRIVE_MAJOR = 98, FH_CYGDRIVE= FHDEV (DEV_CYGDRIVE_MAJOR, 0), FH_CYGDRIVE_A= FHDEV (DEV_CYGDRIVE_MAJOR, 'a'), FH_CYGDRIVE_Z= FHDEV (DEV_CYGDRIVE_MAJOR, 'z'), diff --git a/winsup/cygwin/devices.shilka b/winsup/cygwin/devices.shilka index f029c71e3..b7f1dfdf5 100644 --- a/winsup/cygwin/devices.shilka +++ b/winsup/cygwin/devices.shilka @@ -326,7 +326,7 @@ device::parse (const char *s) if (++len < prior_len) { dev = KR_find_keyword (s, len); - if (!dev || !dev->upper) + if (!dev || (!dev->upper && dev->devn != FH_TTY)) dev = NULL; else { diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index b616ac1c3..680b12dc0 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -326,7 +326,7 @@ proc_subproc (DWORD what, DWORD val) ProtectHandle1 (vchild->pid_handle, pid_handle); if (!DuplicateHandle (hMainProc, hMainProc, vchild->hProcess, &vchild->ppid_handle, - 0, TRUE, DUPLICATE_SAME_ACCESS)) + SYNCHRONIZE | PROCESS_DUP_HANDLE, TRUE, 0)) system_printf ("Couldn't duplicate my handle<%p> for pid %d, %E", hMainProc, vchild->pid); vchild->ppid = myself->pid; vchild->uid = myself->uid;