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

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Oct 24 09:38:00 GMT 2019


On Oct 24 10:01, Takashi Yano wrote:
> 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?

Well, what I see when starting cmd.exe with this patch is a short
flicker in the existing output in mintty, but the cursor position
stays the same. and cmd.exe output is where you'd expect it.

> 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)

If it's running as Local System (actually SYSTEM), it should have
the user SID S-1-5-18.  You can just check this with

  cygheap->user.saved_sid () == well_known_system_sid


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20191024/197431c5/attachment.sig>


More information about the Cygwin-patches mailing list