* fhandler_console.cc (fhandler_console::set_unit): Don't succeed unless we are
opening a console actually associated with this process.
This commit is contained in:
		| @@ -1,6 +1,11 @@ | |||||||
|  | 2012-03-29  Christopher Faylor  <me.cygwin2012@cgf.cx> | ||||||
|  |  | ||||||
|  | 	* fhandler_console.cc (fhandler_console::set_unit): Don't succeed | ||||||
|  | 	unless we are opening a console actually associated with this process. | ||||||
|  |  | ||||||
| 2012-03-29  Corinna Vinschen  <corinna@vinschen.de> | 2012-03-29  Corinna Vinschen  <corinna@vinschen.de> | ||||||
|  |  | ||||||
| 	* sec_acl.cc (acl32): Fix potnetial crash if build_fh_name returns NULL. | 	* sec_acl.cc (acl32): Fix potential crash if build_fh_name returns NULL. | ||||||
|  |  | ||||||
| 2012-03-29  Christopher Faylor  <me.cygwin2012@cgf.cx> | 2012-03-29  Christopher Faylor  <me.cygwin2012@cgf.cx> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -135,6 +135,7 @@ fhandler_console::set_unit () | |||||||
|   bool created; |   bool created; | ||||||
|   fh_devices devset; |   fh_devices devset; | ||||||
|   lock_ttys here; |   lock_ttys here; | ||||||
|  |   HWND me; | ||||||
|   if (shared_console_info) |   if (shared_console_info) | ||||||
|     { |     { | ||||||
|       fh_devices this_unit = dev (); |       fh_devices this_unit = dev (); | ||||||
| @@ -146,9 +147,14 @@ fhandler_console::set_unit () | |||||||
| 		|| this_unit == FH_TTY) ? | 		|| this_unit == FH_TTY) ? | ||||||
| 		shared_unit : FH_ERROR; | 		shared_unit : FH_ERROR; | ||||||
|     } |     } | ||||||
|  |   else if ((myself->ctty != -1 && !iscons_dev (myself->ctty)) | ||||||
|  | 	   || !(me = GetConsoleWindow ())) | ||||||
|  |     { | ||||||
|  |       created = false; | ||||||
|  |       devset = FH_ERROR; | ||||||
|  |     } | ||||||
|   else |   else | ||||||
|     { |     { | ||||||
|       HWND me = GetConsoleWindow (); |  | ||||||
|       created = true; |       created = true; | ||||||
|       shared_console_info = open_shared_console (me, cygheap->console_h, created); |       shared_console_info = open_shared_console (me, cygheap->console_h, created); | ||||||
|       ProtectHandleINH (cygheap->console_h); |       ProtectHandleINH (cygheap->console_h); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user