Having serached Google I've found a couple of queries about this but no easy solutions. Has anyone wrapped up the various win32 file/security calls to give simple access to setting NTFS file permissions ? Whilst trying to work out how to do this I found that there is a Perl (hiss) module (or whatever they are called) "Win32 Perms" which does this. I've started from the sample in Mark Hammond/Andy Robinson's Python Win32 book in "batchusercreate" where he sets access permissions on a share but I want to set the permissions on the actual directory. Cutting it back as far as I can for testing, trying simply to copy a security descriptor; import win32security sd=win32security.GetFileSecurity('g:\\TestACL\\aaa.txt',win32security. DACL_SECURITY_INFORMATION) win32security.SetFileSecurity('g:\\TestACL\\bbb.txt',win32security. DACL_SECURITY_INFORMATION,sd) results in an error message "the data area passed to a system call is too small" but the permissions are copied. Using batchusercreate as a model to create a new DACL and apply that to a directory results in the usernames being applied but access not set. Applying to a file does set access permissions but both attempts result in an error message with a helpful message - "No error message available". Anyone know what's wrong with the above, or better still, got a simplified wrapper around the various API calls, (in fact I don't think win32 has all that might be needed - e.g. GetSecurityDescriptorDACL to handle all requirements). The only reason for wanting to do this is some simple web browser based user management, without the need to resort to - os.system("echo y| cacls....). -- ___ |im ---- ARM Powered ----
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4