On 2023-10-03 09:42, Cedric Blancher via Cygwin wrote:
I tried a simple three line hello world program, which tries to get
the SID for Unix_User+1:
bash -c 'getent passwd "Unix_User+1"'
Unix_User+1:*:4278190081:4278190081:U-Unix_User\1,S-1-22-1-1:/:/sbin/nologin

But putting "S-1-22-1-1" into ConvertStringSidToSidA("S-1-22-1-1",
&sid) fails with ERROR_INVALID_SID on Cygwin.

Why? I thought SMB had "S-1-22-1-*" reserved for its usage, and Cygwin
uses Unix_User+1 in it's output.
How can I get ConvertStringSidToSidA("S-1-22-1-1", &sid) working in my program?

Cygwin's focus is on using POSIX tools to do useful work on Windows hosts, avoiding the native APIs and tools because of their innumerable shortcomings.

You should ask these Windows queations on more appropriate forums, such as MS, Mingw64, Msys2, or SO:

https://stackoverflow.com/questions/54894967/why-does-convertstringsidtosid-fail-to-convert-a-string-sid

after carefully reading the MS docs:

https://learn.microsoft.com/en-us/windows/win32/api/sddl/nf-sddl-convertstringsidtosida

and use a (re-/)search tool to find this basic background information and answers to queries, not ask on Cygwin lists.

--
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

Today is Tuesday, September 10990, 1993, the September that never ends

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