I'm attempting to add a user to a security object using the Win32::Perms package, but have not had any success.

I'm using IndigoPerl, on a Win2K system, rather than ActiveState's Perl. I was able to install the Win32::Perms package using IndioPerl's Package Manager. I obtained the package directly from http://www.roth.net/perl/packages/win32-perms.ppd. The version of IndigoPerl is perl, v5.6.1 built for MSWin32-x86-multi-thread.

The following is a code fragment from my Perl script.

$path = "F:\Test"; $sd = new Win32::Perms($path); $result = $sd -> Allow( "SYSTEM", FULL ); if ($result == 0) { print "Win32 error number: $Win32Error\n"; print "Win32 error message: ", Win32::FormatMessage ($Win32Error), "\n"; }
This code always fails. The Win32 error number is 53 which is "The network path was not found". I get the same error if I use a different user (e.g., SYSTEM) or if I use the sd -> Add() instead of Allow().

Note: I've been able to dump the contents of a security descriptor (using Dump() or Get()) and remove a user account from the security descriptor. Also, I've been able to copy a set of permissions from one study descriptor to another.

What am I doing wrong? Or doesn't the Win32::Perms package work with any other Perl except ActiveState?

Thanks,

Rob


In reply to Problem using Win32::Perms by rgold

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.