Title: RE: Win32::Perms Question
Thanks to Chris for asking the question and especially to Dave for shedding some light.  I've been struggling with a script using Win32::Perms for some time and couldn't get the mask and flags right.  I took Dave's advice, setup a directory and permissions with explorer and then created a simple script to dump to stdout. 
 
Setup the permissions on the directory using explorer and then use this script to dump to stdout.
use Win32::Perms;
$path = "\\\\server\\share\\folder";
$Dir = new Win32::Perms ($path);
$Dir->Dump;
 
When a user account and home directory is created using usrmgr.exe the BUILTIN\Administrators group has the Mask: 0x001f01ff, Type: Allow, Flag: 0x00000000.  In explorer, this translates to Special Access (ALL)(Not Specified).  By changing the flag to 0x00000003 I get the correct permissions.
 
This script gives the BUILTIN\Administrators group Full permissions and the only difference is the flag.
$Dir->Add( {Account=>'\\\\Server\\Administrators', Mask=>0x001f01ff, Type=>Allow, Flag=>0x00000003} );
$Dir->Set();
 
Mark
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 1:41 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Win32::Perms Question

Chris,
Microsoft Explorer interprets the perms settings differently depending upon the version of Windows. What may be called "Full Control" under NT 4.0 ended up being "Special Permissions" in Win2k. So I am hesitant to suggest any single thing for you.

Your best bet  is to manually set the permissions the way you like using the Explorer program. Then use Win32::Perms to dump the acual ACL and ACE flags/mask. You can then use that list as your template of what constants to apply in your script.

dave

     -----Original Message-----
    From:   Christopher J. Mackie [mailto:[EMAIL PROTECTED]]
    Sent:   Thursday, February 14, 2002 11:23 AM
    To:     [EMAIL PROTECTED]
    Subject:        Win32::Perms Question

     << Message: Untitled Attachment >>  << File: Christopher J. Mackie.vcf >>


This E-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended only for the use of the Individual(s) named above. If you are not the intended recipient of this E-mail, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination or copying of this E-mail is strictly prohibited. If you have received this E-mail in error, please immediately notify us at (865) 374-4900 or notify us by E-mail at [EMAIL PROTECTED]

Reply via email to