[PATCH] Cygwin: pty: Disable clear screen for ssh sessions with -t option.

Takashi Yano takashi.yano@nifty.ne.jp
Thu Oct 24 01:01:00 GMT 2019


Hi Corinna,

On Wed, 23 Oct 2019 14:05:42 +0200
Corinna Vinschen wrote:
> In my limited testing it seems to work nicely.

Isn't the screen contents before opening pty cleared when cmd.exe is
executed?

Also Michael's test case probably does not work.
https://www.cygwin.com/ml/cygwin-patches/2019-q4/msg00054.html

> > +static bool
> > +is_running_as_service (void)
> 
> This function should probably use check_token_membership(PSID).
> I'm also not quite sure if checking for mandatory_system_integrity_sid
> makes sense.  Are there examples where the service SID is missing
> but the integrity is set to system integrity level?

If sshd or inetd is executed as cyg_server, S-1-5-6 (Service) is set.
However, when they are executed as Local System Account, only SIDs
set are as follows.

S-1-5-32-544 (Administrators)
S-1-1-0 (Everyone)
S-1-5-11 (Authenticated Users)
S-1-16-16384 (Mandatory System Integrity)

In this case, S-1-16-16384 does not have SE_GROUP_ENABLED flag, so
check_token_membership() can not be used.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>



More information about the Cygwin-patches mailing list