"Unknown" Groups Not Caching - Debugging

Bryan Berns bryan.berns@gmail.com
Fri Apr 17 02:50:00 GMT 2015


Posting here because that's what Corinna told me to do.

So I was looking into the issue I found with Cygwin not caching
orphaned / unknown groups.  At least for my test case, this appears to
be rooted in the RID getting striped from the end of the SID just
prior to the line being outputted (line 2464 from the exert below)
within fetch_account_from_windows().

uinfo.cc: 2460: /* Check if we know the domain.  If so, create a passwd/group
uinfo.cc: 2461:    entry with domain prefix and RID as username. */
uinfo.cc: 2462: PDS_DOMAIN_TRUSTSW td = NULL;
uinfo.cc: 2463:
uinfo.cc: 2464: sid_sub_auth_count (sid) = sid_sub_auth_count (sid) - 1;

It's not clear to me, in general, why we're interested in creating a
"passwd/group entry with domain prefix and RID as username".  There
are quite a few nuances and special cases in this function so I feel
like any attempt on my part to produce a patch on this will likely be
completely errant.  Might someone familiar with check weigh-in on
these findings thus far?

I've attached my test script (Windows Batch).
-------------- next part --------------
@ECHO OFF
NET LOCALGROUP LocalGroupTest /ADD
IF EXIST C:\LocalGroupTestDir RD /S /Q C:\LocalGroupTestDir 
MKDIR C:\LocalGroupTestDir
FOR /L %%X IN (1,1,1000) DO ECHO TestFile > C:\LocalGroupTestDir\Test.%%X
FOR /L %%X IN (1,1,1000) DO ICACLS C:\LocalGroupTestDir\Test.%%X /grant LocalGroupTest:M > NUL
ECHO Running Time Tests While Group Exists...
"C:\cygwin\bin\bash.exe" -c 'time /bin/ls -l /cygdrive/c/LocalGroupTestDir ^> /dev/null'
"C:\cygwin\bin\bash.exe" -c 'time /bin/ls -l /cygdrive/c/LocalGroupTestDir ^> /dev/null'
"C:\cygwin\bin\bash.exe" -c 'time /bin/ls -l /cygdrive/c/LocalGroupTestDir ^> /dev/null'
"C:\cygwin\bin\bash.exe" -c '/bin/strace -o run-good.txt /bin/ls -l /cygdrive/c/LocalGroupTestDir ^> /dev/null'
NET LOCALGROUP LocalGroupTest /DELETE
ECHO Running Time Tests After Group Deletion...
"C:\cygwin\bin\bash.exe" -c 'time /bin/ls -l /cygdrive/c/LocalGroupTestDir ^> /dev/null'
"C:\cygwin\bin\bash.exe" -c 'time /bin/ls -l /cygdrive/c/LocalGroupTestDir ^> /dev/null'
"C:\cygwin\bin\bash.exe" -c 'time /bin/ls -l /cygdrive/c/LocalGroupTestDir ^> /dev/null'
"C:\cygwin\bin\bash.exe" -c '/bin/strace -o run-bad.txt /bin/ls -l /cygdrive/c/LocalGroupTestDir ^> /dev/null'
PAUSE


More information about the Cygwin-developers mailing list