Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong UID mapping SID in v1.9 #381

Open
zhouxin15 opened this issue Aug 10, 2021 · 2 comments
Open

Wrong UID mapping SID in v1.9 #381

zhouxin15 opened this issue Aug 10, 2021 · 2 comments

Comments

@zhouxin15
Copy link

In winfsp1.9 windows10 testingg mode, I ran into the same question as Wrong UID mapping - SID 65534 #199.

D:\winfsp-1.9\winfsp-1.9\winfsp-1.9\build\VStudio\build\Release> .\fsptool-x64.exe id
User=S-1-5-21-147214757-305610072-1517763936-8390753(CHINA\z50018242) (uid=9439329)
Owner=S-1-5-21-147214757-305610072-1517763936-8390753(CHINA\z50018242) (uid=9439329)
Group=S-1-5-21-147214757-305610072-1517763936-513(CHINA\Domain Users) (gid=1049089)

D:\winfsp-1.9\winfsp-1.9\winfsp-1.9\build\VStudio\build\Release> .\fsptool-x64.exe id 9439329
S-1-0-65534() (uid=65534)

Then, I modified the /src/shared/ku/posix.c

477        else if (0x100000 <= Uid && Uid < 0xff000000)
              {	
479               if ((Uid < 0xf00000 || 0 == FspTrustedDomainCount) &&
                      0 != FspPrimaryDomainSid &&
                      5 == FspPrimaryDomainSid->IdentifierAuthority.Value[5] &&
                      4 == FspPrimaryDomainSid->SubAuthorityCount)
                  {
                      *PSid = FspPosixCreateSid(5, 5,
                          21,
                          FspPrimaryDomainSid->SubAuthority[1],
                          FspPrimaryDomainSid->SubAuthority[2],
                          FspPrimaryDomainSid->SubAuthority[3],
                          Uid - 0x100000);
490               }

the user get the correct uid mapping

D:\winfsp-1.9\winfsp-1.9\winfsp-1.9\build\VStudio\build\Release> .\fsptool-x64.exe id
User=S-1-5-21-147214757-305610072-1517763936-8390753(CHINA\z50018242) (uid=9439329)
Owner=S-1-5-21-147214757-305610072-1517763936-8390753(CHINA\z50018242) (uid=9439329)
Group=S-1-5-21-147214757-305610072-1517763936-513(CHINA\Domain Users) (gid=1049089)

D:\winfsp-1.9\winfsp-1.9\winfsp-1.9\build\VStudio\build\Release> .\fsptool-x64.exe id 9439329
S-1-5-21-147214757-305610072-1517763936-8390753(CHINA\z50018242) (uid=9439329)

But when i tried to fully build Winfsp with the build.bat, i ran into a problem

SIGNING FAILED The product has been successfully built, but not signed.
installer msi not found

@zhouxin15
Copy link
Author

Moreover, the winfsp1.8 can map the uid to the correct sid

D:\winfsp-1.8msi\bin>fsptool-x64.exe id
User=S-1-5-21-147214757-305610072-1517763936-8390753(CHINA\z50018242) (uid=9439329)
Owner=S-1-5-21-147214757-305610072-1517763936-8390753(CHINA\z50018242) (uid=9439329)
Group=S-1-5-21-147214757-305610072-1517763936-513(CHINA\Domain Users) (gid=1049089)

D:\winfsp-1.8msi\bin>fsptool-x64.exe id 9439329
S-1-5-21-147214757-305610072-1517763936-8390753(CHINA\z50018242) (uid=9439329)

@sganis sganis Sorry to bother you. I just want to ask you, did you try the winfsp1.9 and meet the same problem

@sganis
Copy link
Contributor

sganis commented May 23, 2023

I tested this in 1.9 and later, it is working fine in my system, sorry for late response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants