On Tue, 20 Dec 2022 22:48:06 +0100 Corinna Vinschen wrote: > On Dec 20 21:45, Takashi Yano wrote: > > Previously, the console device could not be accessed from other terminals. > > Due to this limitation, GNU screen and tmux cannot be opened in console. > > With this patch, console device can be accessed from other TTYs, such as > > other consoles or ptys. Thanks to this patch, screen and tmux get working > > in console. > > > > Signed-off-by: Takashi Yano <[email protected]> > > --- > > winsup/cygwin/devices.cc | 24 +- > > winsup/cygwin/devices.in | 24 +- > > winsup/cygwin/fhandler/console.cc | 438 +++++++++++++++++------- > > winsup/cygwin/fhandler/pty.cc | 4 +- > > winsup/cygwin/local_includes/fhandler.h | 26 +- > > winsup/cygwin/local_includes/winsup.h | 1 - > > winsup/cygwin/select.cc | 2 + > > 7 files changed, 382 insertions(+), 137 deletions(-) > > I just toyed around with screen and this looks really great. > > Just one question: What about security? If we now can share > consoles, don't we need fchmod/fchown calls, too?
Thanks for reviewing. As for security, AttachConsole() for another user's process will failed with ERROR_ACCESS_DENIED, so the console of another user is inaccessible. However, fstat() does not return appropriate information, so, I implemented fhandler_console::fstat(). I also set proper errno for that case. Please see v2 patch. -- Takashi Yano <[email protected]>
