I have been asked to write a program that will pull the NTFS security data off of a remote file. I have seen severl comments relating to the fact that Win32::Perms is no longer supported and the information I can find on Win32:Security and Win32::FileSecurity is scarce and the information I can find is not really clear.
Does anyone no a way that I can read the NTFS security data off or a remote file?
What I am looking for is the standard security settings:
Full Control
Modify
Read & Execute
List Folder Contents
Read
Write
and not the:
DELETE
READ_CONTROL
WRITE_DAC
WRITE_OWNER
SYNCHRONIZE
STANDARD_RIGHTS_REQUIRED
STANDARD_RIGHTS_READ
STANDARD_RIGHTS_WRITE
STANDARD_RIGHTS_EXECUTE
STANDARD_RIGHTS_ALL
READ
CHANGE
ADD
FULL
ADD & READ
READ_CONTROL
WRITE_DAC
WRITE_OWNER
SYNCHRONIZE
STANDARD_RIGHTS_REQUIRED
STANDARD_RIGHTS_READ
STANDARD_RIGHTS_WRITE
STANDARD_RIGHTS_EXECUTE
STANDARD_RIGHTS_ALL
READ
CHANGE
ADD
FULL
ADD & READ
Which is all I can seem to get returned. The reason the above will not work is because the mask id is the same for different combinations of the Standard NTFS permissions. i.e. Read & Execute, List Folder Contents, Read has the same results as just Read.
The program I am using to get the above style info is:
#!/usr/bin/perl
# Gets the rights for all files listed on the command line.
use Win32::FileSecurity qw(Get EnumerateRights);
use Win32::FileSecurity qw(Get EnumerateRights);
foreach( @ARGV ) {
next unless -e $_ ;
if ( Get( $_, \%hash ) ) {
while( ($name, $mask) = each %hash ) {
print "$name \n";
EnumerateRights( $mask, [EMAIL PROTECTED] ) ;
next unless -e $_ ;
if ( Get( $_, \%hash ) ) {
while( ($name, $mask) = each %hash ) {
print "$name \n";
EnumerateRights( $mask, [EMAIL PROTECTED] ) ;
foreach $Sec (@happy) {
print "\t$Sec\n";
}
}
else {
print( "Error #", int( $! ), ": $!" ) ;
}
}
print "\t$Sec\n";
}
}
else {
print( "Error #", int( $! ), ": $!" ) ;
}
}
Maybe someone has a fix to this to return the results I want.
or maybe we just need to BEG Roth to update the Win32:Perms.
HELP!!!!
Thanks, Ryan
_______________________________________________ Perl-Win32-Admin mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
