[python-win32] Getting security info about a file

Itamar S.-T. itamarst@yahoo.com
Thu, 10 May 2001 08:53:01 -0700 (PDT)


Hi,

lets say I want to get the security information on a
file. So I do:

>>> o = win32security.GetFileSecurity(r"c:\mingc.pyd",
win32security.OWNER_SECURITY_INFORMATION)
>>> o
<PySECURITY_DESCRIPTOR object at 010E9350>


So what do I do with 'o' now in order to get the
owner? I tried:

>>> s = win32security.SID(o)
>>> win32security.LookupAccountSid(None, s)
Traceback (innermost last):
  File "<interactive input>", line 1, in ?
api_error: (1332, 'LookupAccountSid', 'No mapping
between account names and security IDs was done.')

What am I doing wrong?

=====
Itamar Shtull-Trauring, itamar(at)shtull-trauring.org

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/