IAccount bug

delphi package - easy access to security apis

IAccount bug

Postby pascal jankowski » Tue May 09, 2006 9:10 am

Hello Mathias,

I try to uses madSecurity Unit with IAccount interface to know ACE'owner for all file on my disk (a lot of).
I obtain each time a overflow of memory

Code and execute this example
Code: Select all
for I := 0 to 1000000 do
 with FileSecurity('c:\myTestFile.ext') do
    s := Items[I].Account.domain;  //or user   


Observe the behavior of the following processes. (lsass.exe and project1.exe)

I think that you do not release the token correctly...


-----------
My temporary solution not to encounter this problem.

Code: Select all
function LookupAccountBySid(Sid: PSID): String;
var
    Name,
    Domain     : String;
    NameSize,
    DomainSize : DWORD;
    Use        : Cardinal;
begin
    NameSize := 0;
    DomainSize := 0;
    LookupAccountSid(nil, Sid, nil, NameSize, nil, DomainSize, Use);
    SetLength(Name, NameSize);
    SetLength(Domain, DomainSize);
    LookupAccountSid(nil, Sid, PChar(Name), NameSize, PChar(Domain), DomainSize, Use);
    Result := PChar(Domain) + '/' + PChar(Name);
end;

Code: Select all
LookupAccountBySid(FileSecurity('c:\myTestFile.ext').Items[I].Account.PSid);


Best regard
pascal jankowski
 
Posts: 2
Joined: Tue May 09, 2006 8:56 am

Postby madshi » Wed May 10, 2006 7:08 am

Thanks for the report, I'll have a look at this.
madshi
Site Admin
 
Posts: 9663
Joined: Sun Mar 21, 2004 5:25 pm

Postby madshi » Fri May 26, 2006 10:18 am

Could you please try this one?

http://madshi.net/madCollectionBeta.exe

It should fix the problem, I think.
madshi
Site Admin
 
Posts: 9663
Joined: Sun Mar 21, 2004 5:25 pm

Postby pascal jankowski » Mon May 29, 2006 12:56 pm

it is good, thank you for this version. :D
pascal jankowski
 
Posts: 2
Joined: Tue May 09, 2006 8:56 am


Return to madSecurity

Who is online

Users browsing this forum: No registered users and 1 guest