public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: Takashi Yano <takashi.yano@nifty.ne.jp>
Cc: cygwin-developers@cygwin.com
Subject: Re: [PATCH v5 1/1] Cygwin: pty: add pseudo console support.
Date: Mon, 12 Aug 2019 12:50:00 -0000	[thread overview]
Message-ID: <20190812125005.GH11632@calimero.vinschen.de> (raw)
In-Reply-To: <20190812210708.109e5a8de991875e65d11792@nifty.ne.jp>

[-- Attachment #1: Type: text/plain, Size: 2775 bytes --]

Hi Takashi!


I'm glad to read from you again :)

On Aug 12 21:07, Takashi Yano wrote:
> Hi Corinna,
> 
> On Mon, 24 Jun 2019 12:53:37 +0200
> Corinna Vinschen wrote:
> > Any news on this?  Do you consider the latest state from April
> > stable enough for master?
> 
> First, I apologize for a very lazy response. To tell the truth,
> there has not been much progress.

No worries.

> Anyway, I will post v6 soon. It is almost stable.

An important question is if we should put this into Cygwin 3.1 or if
it's better to keep the 3.1 release the "FIFO revamp" release and make
3.2 the WinPTY release.  That's probably the better approach...

> In my test, the biggest problem is the failure to attach console
> after setuid() in sshd if the user belongs to "Users" group only.
> This causes mis-synchronization in the screen buffer.
> 
> To reproduce this problem, login to cygwin via ssh and execute
> ssh again. Then some debug messages are shown as follows.
> 
> Last login: Mon Aug 12 20:15:54 2019 from ::1
> CYGWIN_NT-10.0-WOW Express5800-S70 3.1.0(0.340/5/3) 2019-08-12 09:42 i686 Cygwin
> [yano@Express5800-S70 ~]$ ssh localhost
>       1 [main] ssh 1927 fhandler_pty_slave::push_to_pcon_screenbuffer: pty1: AttachConsole(21124) failed. (0x612E3C50) 00000005
>      52 [main] ssh 1927 fhandler_pty_slave::push_to_pcon_screenbuffer: pty1: AttachConsole(21124) failed. (0x612E3C50) 00000005
> yano@localhost's password:
> 
> That is, if the following commands are executed sequentially:
> 
> ssh localhost
> ssh localhost (again)
> ls
> exit
> cmd
> 
> the result of ls disappears from the screen.
> 
> This problem does not occur if the user belongs to "Administrators"
> group.
> 
> It is reasonable to fail to attach console to
> cygwin-console-helper.exe because it is running as system
> service account, however, attaching to other processes executed
> by myself also fails in the ssh session.
> 
> I have been stuck with this issue in the last several weeks.
> Any advice will be appreciated. 

It's likely a result of the console object's DACL no?  I guess it's
equivalent to the default DACL of the creating process.  If so, it's
kind of like

  SYSTEM:rwx
  Administrators:rwx. 

It may be worth a try to use the get_object_sd, et_object_sd,
create_object_sd_from_attribute functions along the lines of what
fhandler_pty_slave::fchmod and fhandler_pty_slave::fchown do to add a
user to the console DACL.

This may fail on Windows Vista because of the console being represented
by a pseudo handle only, but it may work just fine starting with Windows
7.  Assuming the security stuff makes sense without the WinPTY code at
all...


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-08-12 12:50 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-30 13:08 Pseudo console support in PTY Takashi Yano
2019-03-30 19:47 ` Corinna Vinschen
2019-03-30 19:59   ` Corinna Vinschen
2019-03-30 23:07 ` Thomas Wolff
2019-03-31 14:38   ` Corinna Vinschen
2019-03-31 15:00   ` Takashi Yano
2019-04-02 11:02 ` Corinna Vinschen
2019-04-02 17:16   ` Thomas Wolff
2019-04-02 17:51     ` Corinna Vinschen
2019-04-03  7:18       ` Thomas Wolff
2019-04-03  7:28         ` Corinna Vinschen
2019-04-03  7:55           ` Thomas Wolff
2019-04-03  8:02             ` Corinna Vinschen
2019-04-03 11:33               ` Thomas Wolff
2019-04-03 12:17                 ` Corinna Vinschen
2019-04-04  4:17                   ` Takashi Yano
2019-04-04  8:06                     ` Corinna Vinschen
2019-04-04  4:15             ` Takashi Yano
2019-04-03 16:36   ` [PATCH v2 0/1] Pseudo console support in PTY (v2) Takashi Yano
2019-04-03 16:37     ` [PATCH v2 1/1] Cygwin: pty: add pseudo console support Takashi Yano
2019-04-03 16:50     ` [PATCH v2 0/1] Pseudo console support in PTY (v2) Corinna Vinschen
2019-04-04  5:27       ` Takashi Yano
2019-04-04  8:17         ` Thomas Wolff
2019-04-04  9:34           ` Takashi Yano
2019-04-03 17:11     ` Corinna Vinschen
2019-04-04  8:59       ` Takashi Yano
2019-04-04 10:46         ` Corinna Vinschen
2019-04-06 11:13           ` [PATCH v3 0/1] Pseudo console support in PTY (v3) Takashi Yano
2019-04-06 11:14             ` [PATCH v3 1/1] Cygwin: pty: add pseudo console support Takashi Yano
2019-04-06 17:43             ` [PATCH v3 0/1] Pseudo console support in PTY (v3) Corinna Vinschen
2019-04-12 10:22               ` [PATCH v4 0/1] Pseudo console support in PTY (v4) Takashi Yano
2019-04-12 10:23                 ` [PATCH v4 1/1] Cygwin: pty: add pseudo console support Takashi Yano
2019-04-12 12:29                 ` [PATCH v4 0/1] Pseudo console support in PTY (v4) Corinna Vinschen
2019-04-15  8:18                   ` Corinna Vinschen
2019-04-15 23:17                     ` Takashi Yano
2019-04-14 15:23                 ` [PATCH v5 0/1] Pseudo console support in PTY (v5) Takashi Yano
2019-04-14 15:23                   ` [PATCH v5 1/1] Cygwin: pty: add pseudo console support Takashi Yano
2019-04-15  8:38                     ` Corinna Vinschen
2019-04-16  0:41                       ` Takashi Yano
2019-04-16  9:16                         ` Corinna Vinschen
2019-06-24 10:53                           ` Corinna Vinschen
2019-07-25 14:31                             ` Corinna Vinschen
2019-08-08 19:24                               ` Corinna Vinschen
2019-08-12 12:07                             ` Takashi Yano
2019-08-12 12:50                               ` Corinna Vinschen [this message]
2019-08-12 14:36                                 ` Takashi Yano
2019-04-14 16:06                   ` [PATCH v5 0/1] Pseudo console support in PTY (v5) Takashi Yano
2019-04-16  1:49                     ` Takashi Yano
2019-04-16  1:51                       ` Takashi Yano
2019-04-06 21:33             ` [PATCH v3 0/1] Pseudo console support in PTY (v3) Thomas Wolff
2019-04-07  5:05               ` Takashi Yano
2019-04-07 12:02                 ` Takashi Yano
2019-04-07 21:21                 ` Thomas Wolff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190812125005.GH11632@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin-developers@cygwin.com \
    --cc=takashi.yano@nifty.ne.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).