G:\>perl -e "use Win32::Security::NamedObject; my $f = Win32::Security::NamedObject->new('FILE','foo.txt'); my $d=$f->dacl(); print $d->dump;"
Win32::Security::ACL->new('SE_FILE_OBJECT',
['ACCESS_ALLOWED_ACE_TYPE', 'INHERITED_ACE', 'READ', 'S-1-5-21-1242909238-215958010-794563710-513'],
['ACCESS_ALLOWED_ACE_TYPE', 'INHERITED_ACE', 'FULL', 'S-1-5-21-1242909238-215958010-794563710-7176'],
['ACCESS_ALLOWED_ACE_TYPE', 'INHERITED_ACE', 'READ', 'S-1-5-21-81088256-2045271245-1062434389-513'],
['ACCESS_ALLOWED_ACE_TYPE', 'INHERITED_ACE', 'FULL', 'S-1-5-21-854245398-842925246-682003330-500'],
['ACCESS_ALLOWED_ACE_TYPE', 'INHERITED_ACE', 'FULL', 'BUILTIN\Administrators'],
['ACCESS_ALLOWED_ACE_TYPE', 'INHERITED_ACE', 'READ', 'NT AUTHORITY\Authentic
ated Users']
)
G:\>perl -e "use Win32::Security::NamedObject; my $f = Win32::Security::NamedObject->new('FILE','foo.txt'); my $d=$f->dacl(); $d->deleteAces(sub {return ($_->trustee() =~ m/^S-1/)});$f->dacl($d,PROTECTED_DACL_SECURITY_INFORMATION);"
G:\>perl -e "use Win32::Security::NamedObject; my $f = Win32::Security::NamedObject->new('FILE','foo.txt'); my $d=$f->dacl(); print $d->dump;"
Win32::Security::ACL->new('SE_FILE_OBJECT',
['ACCESS_ALLOWED_ACE_TYPE', undef, 'FULL', 'BUILTIN\Administrators'],
['ACCESS_ALLOWED_ACE_TYPE', undef, 'READ', 'NT AUTHORITY\Authenticated Users']
)
Josh Quintus wrote:
I am trying to write a simple script that will copy all of the windows file permissions from one file to another file. According to the documentation, this is exactly what Win32::FileSecurity does. However I keep coming into the same error, for which I cannot find any documentation.
It pretty much boils down to whenever I call the 'Set' method i get this runtime error:
Error handling error: 1722, LookupAccountName
I am running this in a winXP system with an NTFS formated file system, using ActivePerl v5.8.
The code snippet provided is from the documentation for Win32::FileSecurity
use Win32::FileSecurity qw(MakeMask Get Set);
# These masks show up as Full Control in File Manager $file = MakeMask( qw( FULL ) );
$dir = MakeMask( qw( FULL GENERIC_ALL ) );
foreach( @ARGV ) { s/\\$//; next unless -e; Get( $_, \%hash ) ; $hash{Administrator} = ( -d ) ? $dir : $file ; Set( $_, \%hash ) ; }
thanks in advance
_________________________________________________________________
Planning a family vacation? Check out the MSN Family Travel guide! http://dollar.msn.com
_______________________________________________ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
-- , , , | Duane Bronson /|/|/| , | [EMAIL PROTECTED] ( ( ( |/| | http://www.nerdlogic.com/ \ ( | | 453 Washington St. #4A, Boston, MA 02111 | / | (617) 515-2909
_______________________________________________ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm

