Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2022-08-19 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?