Toby Everett
2004-01-24 18:17:44 UTC
I'm the developer of a recently released Perl module that provides an
OO interface for manipulating Win32 permissions (Win32::Security).
It's still being fleshed out, but the core is reasonably solid.
The module understands inherited permissions, and so I've been able to
write scripts that search for scenarios where the permissions marked
as inherited don't correlate with the inheritable permissions from the
parent object (i.e. where a user has moved files or objects from one
folder to another on the same volume). It has support for dumping
permissions in CSV (excluding properly inherited permissions, of
course:), fixing mixups like the above, etc.
Right now I'm working on code that will let one take a CSV file with
permissions, make changes to it, and then apply it back onto the file
system. The underlying module uses GetNamedSecurityInfo and
SetNamedSecurityInfo. It occurs to me that while the automatic
propagation of inherited permissions is useful, it would be very
useful to be able to turn it off at times.
For instance, say I want to set permissions on C:\, C:\WINDOWS, and
C:\WINDOWS\system32. That means that when I set the permissions on
C:\, SetNamedSecurityInfo will ripple through the entire file system
checking every single permission. That is all well and good. Then,
when I set the permissions on C:\WINDOWS, SetNamedSecurityInfo will
ripple through the entire WINDOWS tree checking permissions.
Similarly for C:\WINDOWS\system32. Now, this means that every file in
C:\WINDOWS\system32 will have its permissions checked three times.
This is rather inefficient. It would be nice if there was a way to
call SetNamedSecurityInfo and _not_ have it ripple permissions. Then
I would make the calls in reverse order (actually, it doesn't matter
what order I use so long as I make the call to C:\ last), and on the
call to C:\ tell it to ripple permissions. Voila! Efficient use of
computing resources.
Thoughts?
I've thought about using SetFileSecurity, but it's obsolete and I'd
have to hunt for its kindred functions when dealing with the registry,
AD, etc.
--Toby Ovod-Everett
***@ovod-everett.org
OO interface for manipulating Win32 permissions (Win32::Security).
It's still being fleshed out, but the core is reasonably solid.
The module understands inherited permissions, and so I've been able to
write scripts that search for scenarios where the permissions marked
as inherited don't correlate with the inheritable permissions from the
parent object (i.e. where a user has moved files or objects from one
folder to another on the same volume). It has support for dumping
permissions in CSV (excluding properly inherited permissions, of
course:), fixing mixups like the above, etc.
Right now I'm working on code that will let one take a CSV file with
permissions, make changes to it, and then apply it back onto the file
system. The underlying module uses GetNamedSecurityInfo and
SetNamedSecurityInfo. It occurs to me that while the automatic
propagation of inherited permissions is useful, it would be very
useful to be able to turn it off at times.
For instance, say I want to set permissions on C:\, C:\WINDOWS, and
C:\WINDOWS\system32. That means that when I set the permissions on
C:\, SetNamedSecurityInfo will ripple through the entire file system
checking every single permission. That is all well and good. Then,
when I set the permissions on C:\WINDOWS, SetNamedSecurityInfo will
ripple through the entire WINDOWS tree checking permissions.
Similarly for C:\WINDOWS\system32. Now, this means that every file in
C:\WINDOWS\system32 will have its permissions checked three times.
This is rather inefficient. It would be nice if there was a way to
call SetNamedSecurityInfo and _not_ have it ripple permissions. Then
I would make the calls in reverse order (actually, it doesn't matter
what order I use so long as I make the call to C:\ last), and on the
call to C:\ tell it to ripple permissions. Voila! Efficient use of
computing resources.
Thoughts?
I've thought about using SetFileSecurity, but it's obsolete and I'd
have to hunt for its kindred functions when dealing with the registry,
AD, etc.
--Toby Ovod-Everett
***@ovod-everett.org