Hope this is the one I should be looking for?

sub SidToString
{
        return undef
                unless unpack("C", substr($_[0], 0, 1)) == 1;

        return undef
                unless length($_[0]) == 8 + 4 * unpack("C", substr($_[0], 1,
1));

        my $sid_str = "S-1-";
        $sid_str .= (unpack("C", substr($_[0], 7, 1)) + (unpack("C",
substr($_[0], 6, 1)) << 8) +
                     (unpack("C", substr($_[0], 5, 1)) << 16) +
(unpack("C",substr($_[0], 4, 1)) << 24));

        for $loop (0 .. unpack("C", substr($_[0], 1, 1)) - 1)
        {
                $sid_str .= "-" . unpack("I", substr($_[0], 4 * $loop + 8,
4));
        }
        return $sid_str;
}

The input to this will be a binary string right? Or can it be a base64
value?

Thanks.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Chris Wagner
Sent: Thursday, August 11, 2005 10:47 PM
To: perl-win32-admin@listserv.ActiveState.com
Subject: RE: Converting SID value to text

The particular Win32 functions that translate SIDs are pure perl.  U should
be able to just copy those functions from the pm file into ur script and use
them as normal.  See lanman.pm.

At 10:47 PM 8/11/05 -0000, Mayuresh Kshirsagar wrote:
>I want to convert the SID value to a text value. This operation will be
>done on an HP-UX machine. So I can't use the Win32 modules. Is there any
>other way I can do it? Any conversion algorithm or any other perl
>module.






--
REMEMBER THE WORLD TRADE CENTER         ---=< WTC 911 >=--
"...ne cede males"

00000100

_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to