file() and Win32 security attributes

Josiah Carlson jcarlson at nospam.uci.edu
Sun Feb 29 12:33:17 EST 2004


Gerson Kurz wrote:
> Hi all, a quick question: how can I force file() to create files that
> have "ALL ACCESS FOR EVERYONE" security attributes? Other than by a
> major rewrite of my existing code modules replacing the existing
> "native-python" code by win32file / win32security calls? 
> 
> In case you're wondering what is happening here: 
> 
> - user A with admin rights logs on to NT and uses python to create a
> file
> - user A logs off
> - user B without admin rights logs on to NT and uses python to access
> said file -> doesn't work, because B has no admin rights and cannot
> access files created by an administrator.
> 
> Most feasible solution is AAFE, because a more finegrained ACL is a
> nightmare to maintain :) 

If you have win2k, install xcacls:
http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/xcacls-o.asp

I believe XP and 2003 have it by default.

Play around with the command line version until you have it do what you 
want, then perhaps subclass file, and insert permission alteration just 
after closing.

  - Josiah



More information about the Python-list mailing list