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
signature.asc
Description: PGP signature