blackadder has asked for the wisdom of the Perl Monks concerning the following question:

Peace on all,
I have written this script below, which (supposedly) assigns user full access permission to all folders and sub folders including files from a given target location (say drive D$ or a folder like c:\dir\sub_dir.etc). Once I run the script I immediately go to the target location by Explorer, right click on target location, go to properties, then security and I can see the ACE entry that then script has created. When I click on the advanced button in the security tab, and I can see the ace entry with the following attributes:
Type:Allow, Name: Usr_foo, Permission: Full Control, Apply to: This folder, subfolders and files.
However, when I check the security tabs of any subfolders within the targeted location, I do not see the name of the user I have just granted full access at all listed?? Does anyone know an explanation for this please? Or tell me what am I doing wrong
use strict ‘vars’; use Win32::Perms; my $prms = new Win32::Perms(“\\\\server1\\d$\\”) || die “$!, $^E\n”; print $prms->Path(); if ($prms->Allow(‘User_foo’, FULL | FULL, OBJECT_INHERIT_ACE | CONTAIN +ER_INHERIT_ACE)) { print “\nDone\n”; $prms->Set(); } $prms->Dump;

edited: Fri Jun 28 23:10:23 2002 by jeffa - title change - was 'Permissions and Inheritance'

Replies are listed 'Best First'.
Re: Permissions and Inheritance
by Rex(Wrecks) (Curate) on Jun 28, 2002 at 16:37 UTC
    What you need to do is trigger a repropogation of ACLs. Looks like you want $prms->SetRecurse();

    "Nothing is sure but death and taxes" I say combine the two and its death to all taxes!