New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetFileSecurity returns wrong SID #35519
Comments
The following code printes PySID:S-1-0x008014000000 for for f in glob.glob("d:/*.*"):
try:
o =
win32security.GetFileSecurity
(f,win32security.OWNER_SECURITY_INFORMATION)
s = win32security.SID(o)
print str(s),
except:
print "n/a",
print " ",f Interestingly, def prsid(name):
import string
print string.rjust(name,20),
try:
sid,box,what=win32security.LookupAccountName
(None,name)
print str(sid),box,what
except:
print "oops" Works well, so it doesn't seem to be a problem with Thanks for your help in resolving this. P.S.: (Discussed in http://groups.google.com/groups? |
Logged In: YES Reassigned to MarkH, as this is in the Win32 extensions. |
Logged In: YES This is not a bug. The SID() function does not take a The code should change to: s is not the SID of the owner of the file. There is also |
Logged In: NO Hi Mark, I've had a read through all of the information that I could on and then watch fileSecurity in a debugger like Komodo, I find I haven't yet gotten desperate enough to use a tool that To be completely explicit, if I use: Python errors and the traceback looks like this:
Traceback (most recent call last):
File "getfilesecurity.py", line 17, in ?
secInfo = fileSecurity.GetSecurityDesc
AttributeError: GetSecurityDescriptorOwner I love Python and would dearly like to use this API to do Please please please assist; |
Logged In: YES What OS are you on, and what version of win32all. It works >>> import win32security
>>> fileSecurity =
win32security.GetFileSecurity('f:/windows',win32security.OWNER_SECURITY_INFORMATION)
>>> secInfo = fileSecurity.GetSecurityDescriptorOwner()
>>> secInfo
<PySID object at 0x00D18CD8>
>>> |
Logged In: YES Hi Mark, Thanks for getting back to me and giving me the chance to
explore this one. I'm using ActiveState ActivePython 2.1.1
build 212. The Release notes say that this includes your
Win32 extensions build 135. I'm on Windows 2000
Professional Service Pack 2, and am logged in as an
administrator-level account (so permissions shouldn't be an
issue).
I had a look at the RAM where the fileSecurity object was
referenced at, and first line of memory looks like this:
unsigned char data[16] = {
0x01, 0x00, 0x00, 0x00, 0x28, 0xB9, 0x60, 0x1E,
0xD0, 0x94, 0x8A, 0x00, 0x00, 0x00, 0x00, 0x00
};
Dunno if that's really relevant at all, as I haven't yet
familiarised myself with how this type of object is structured,
but if it's any use to you, great :-) Any other information I can supply or things that I can do for Thanks heaps, |
Logged In: YES It appears the new functions arrived in win32all-141 and |
Logged In: YES Hi Mark, Thanks heaps for the pointer - ActiveState's last distribution Cheers, |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: