public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* ConvertStringSidToSidA("S-1-22-1-1", &sid) fails with invalid sid for Unix_User+1
@ 2023-10-03 15:42 Cedric Blancher
  2023-10-03 16:34 ` Brian Inglis
  0 siblings, 1 reply; 2+ messages in thread
From: Cedric Blancher @ 2023-10-03 15:42 UTC (permalink / raw)
  To: cygwin

Good afternoon!

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?

Ced
-- 
Cedric Blancher <cedric.blancher@gmail.com>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ConvertStringSidToSidA("S-1-22-1-1", &sid) fails with invalid sid for Unix_User+1
  2023-10-03 15:42 ConvertStringSidToSidA("S-1-22-1-1", &sid) fails with invalid sid for Unix_User+1 Cedric Blancher
@ 2023-10-03 16:34 ` Brian Inglis
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Inglis @ 2023-10-03 16:34 UTC (permalink / raw)
  To: cygwin; +Cc: Cedric Blancher

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-03 16:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-03 15:42 ConvertStringSidToSidA("S-1-22-1-1", &sid) fails with invalid sid for Unix_User+1 Cedric Blancher
2023-10-03 16:34 ` Brian Inglis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).