Win32::SDDL - SDDL parsing module for Windows
use Win32::SDDL; my $sddl = Win32::SDDL->new( 'service' ); $sddl->Import( 'D:(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPLOCRRC;;;PU)' ); foreach my $mask( @{$sddl->{ACL}} ){ $trustees{ $mask->{Trustee} } = 1; } my @trustees = sort keys %trustees; print scalar( @{$sddl->{ACL}} )." entries found.\n";
This module was created to aid in interpreting SDDL strings commonly used in Windows to represent access control lists. SDDL stands for Security Descriptor Definition Language. Because SDDL uses many predefined constants, it can be difficult to read. This module provides an object-oriented interface for converting and using the information in SDDL strings.
NOTE: For resources relating to SDDL, see the SEE ALSO section of this document.
Example:
my $sddl = Win32::SDDL->new( 'service' );
Creates a new Win32::SDDL object. Optionally, an object type can be provided. The only optional type supported at present is 'service'. This will change the value of certain constants as they have a different meaning for services than they do for files, registry keys, or other objects.
my $sddl_string = 'D:(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPLOCRRC;;;PU)'; $sddl->Import( $sddl_string ) or die( "Error! Unable to import '$sddl_string'!\n" );
All Win32::SDDL objects have the following properties:
The currently loaded SDDL string
The type of SDDL string (changes the description of some constants).
An array of Win32::SDDL::ACE objects.
Each object has the following properties:
An array of flags translated into English.
An array of permissions translated into English.
The type of ACE (SYSTEM_AUDIT,ACCESS_ALLOW, or ACCESS_DENY).
A GUID representing the object type for the ACE (usually empty).
A GUID representing the parent object type if it exists.
The Trustee name.
Right now I'm using WMI to translate SIDs to account names. I would like to find a way to import the Win32 API with a minimal footprint to reduce the size of the module for people who distribute packaged executables and archives of their scripts.
Please contact me if you have any requests or suggestions.
http://windowssdk.msdn.microsoft.com/en-us/library/ms723280.aspx
Copyright 2006 Tim Johnson
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Tim Johnson <tojo2000@tojo2000.com>
2 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
To install Win32::SDDL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Win32::SDDL
CPAN shell
perl -MCPAN -e shell install Win32::SDDL
For more information on module installation, please visit the detailed CPAN module installation guide.