Hi Lluís,

On Apr 10 09:52, Lluís Batlle i Rossell via Cygwin wrote:
> Hello,
> 
> I saw this change to cygwin to ignore S-1-15-3-* SIDs:
> https://www.cygwin.com/cgit/newlib-cygwin/commit/?id=271f187b7b59a6645e24e9c36b60ba31f6527556
> 
> I think, though, that the current code doesn't completely skip
> resolving those never-resolving SIDs.
> 
> I'm annoyed by those SIDs because they slow down any 'stat()' syscall,
> specially with active directory. Here are strace microsecond times
> (500ms):
> 
> 387924  540348 [main] stat 1327 pwdgrp::fetch_account_from_windows:
> LookupAccountSid(S-1-15-3-65536-3323407561-2172269196-3486974656-4132058316-2250862433-3856296919-434318741-3760235072),
> Win32 error 1332
> 186045  726814 [main] stat 1327 pwdgrp::fetch_account_from_windows:
> LookupAccountSid(S-1-15-3-65536-3323407561-2172269196-3486974656-4132058316-2250862433-3856296919-434318741-3760235072),
> Win32 error 1332
> 
> That slows down a lot things like TAB-completion executing, depending on
> the latency of the AD connection.

Yeah, the numbers are really bad.  I can't reproduce these bad timings,
mine are in the vicinity of 5 ms, so I guess I just don't suffer from
the latency to AD.

> I think that the early part of fetch_account_from_windows should filter
> out S-1-15-3-* SIDs as well, instead of asking AD.

Sounds like the right thing to do.  Actually fetch_account_from_windows
performs a lot of its job only after calling one of the Lookup functions,
but we know that some of these SIDs never resolve.  In case of the
capability SIDs, some of them resolve (some of the well-known ones, see
https://devblogs.microsoft.com/oldnewthing/20220503-00/?p=106557) but we
don't handle them at all and just ignore them.

I pushed a patch which skips not only Capability SIDs, but also AzureAD
SIDs, IIS APPPOOL SIDs and Samba-generated SIDs.
https://sourceware.org/cgit/newlib-cygwin/commit/?id=e04891d67ac7

Please give the next test release cygwin-3.7.0-0.52.ge04891d67ac7 a try.


Thanks,
Corinna

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to