You've already forked lazarus-ccr
RxFPC:fix compile on windows. On linux work with winbind user name
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4641 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -49,7 +49,7 @@ uses
|
||||
{$IFDEF WINDOWS}
|
||||
Windows
|
||||
{$ELSE}
|
||||
BaseUnix, users
|
||||
BaseUnix, users, strutils
|
||||
{$ENDIF};
|
||||
(*
|
||||
FileUtil, LazFileUtils, LazUTF8;
|
||||
@ -82,8 +82,6 @@ begin
|
||||
Result := Result + Tmp;
|
||||
end;
|
||||
|
||||
{ TODO -oalexs : In future need rewrite this code for fix mem leak }
|
||||
|
||||
procedure GetFileNameOwner(const SearchDomain, FileName: String; out UserName, DomainName: string);
|
||||
var
|
||||
RCode, RC1:WINBOOL;
|
||||
@ -154,8 +152,11 @@ end;
|
||||
|
||||
procedure GetFileOwnerData(const SearchDomain, FileName: String; out UserName,
|
||||
DomainName: string);
|
||||
{$IF DEFINED(WINDOWS) AND NOT DEFINED(WINCE)}
|
||||
{$ELSE}
|
||||
var
|
||||
SR: stat;
|
||||
{$ENDIF}
|
||||
begin
|
||||
{$IF DEFINED(WINDOWS) AND NOT DEFINED(WINCE)}
|
||||
{ GetFileNameOwner(UTF8ToSys(SearchDomain), UTF8ToSys(FileName), UserName, DomainName);
|
||||
@ -165,7 +166,10 @@ begin
|
||||
{$ELSE}
|
||||
FpStat(FileName, SR);
|
||||
UserName:=users.GetUserName(SR.uid);
|
||||
DomainName:='';//IntToStr( SR.gid);
|
||||
if Pos('\', UserName) > 0 then
|
||||
DomainName:=Copy2SymbDel(UserName, '\') //for unix samba WinBIND
|
||||
else
|
||||
DomainName:='';//IntToStr( SR.gid);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
|
Reference in New Issue
Block a user