[Win32utils-devel] win32-security rough idea

Heesob Park phasis at gmail.com
Mon Jul 7 23:05:25 EDT 2008


2008/7/8 Berger, Daniel <Daniel.Berger at qwest.com>:
> Hi all,
>
> How does this look?
>
> require 'win32/security'
> include Win32
>
> s = Security::SID.new('djberge')
>
> #<Win32::Security::SID:0x2c6c56c
>   @domain="mydomain",
>   @host="myhost",
>   @sid="\001\005\000...",
>   @account_type="user",
>   @account="djberge"
>>
>
> s.length       => 28
> s.account      => 'djberge'
> s.domain       => 'mydomain'
> s.sid          => '\001...'
> s.account_type => 'user'
> s.to_s         => S-1-5-21-55555-444444-88-118888-999999
> s.valid?       => true
> s == s         => true
>
It looks good.

> Here's the implementation so far (more comments at end):
>
<snip>
> I wasn't sure if SID.new should refer to an existing account, or
> actually create a new SID via InitializeSid() or something. My current
> idea is to setup a SID.create method for actually creating a new SID.
> Does that seem reasonable? Or does that seem counterintuitive?
>
> Anyway, there you go. Please let me know what you think.
>
That seems reasonable. Go ahead please.

Regards,

Park Heesob


More information about the win32utils-devel mailing list