mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 15:28:00 +02:00
* Dotted filenames for package users
This commit is contained in:
parent
0707b5f7ca
commit
2c6d0fb7f2
3
packages/users/namespaced/UnixApi.Crypth.pp
Normal file
3
packages/users/namespaced/UnixApi.Crypth.pp
Normal file
@ -0,0 +1,3 @@
|
||||
unit UnixApi.Crypth;
|
||||
{$DEFINE FPC_DOTTEDUNITS}
|
||||
{$i crypth.pp}
|
3
packages/users/namespaced/UnixApi.Grp.pp
Normal file
3
packages/users/namespaced/UnixApi.Grp.pp
Normal file
@ -0,0 +1,3 @@
|
||||
unit UnixApi.Grp;
|
||||
{$DEFINE FPC_DOTTEDUNITS}
|
||||
{$i grp.pp}
|
3
packages/users/namespaced/UnixApi.Pwd.pp
Normal file
3
packages/users/namespaced/UnixApi.Pwd.pp
Normal file
@ -0,0 +1,3 @@
|
||||
unit UnixApi.Pwd;
|
||||
{$DEFINE FPC_DOTTEDUNITS}
|
||||
{$i pwd.pp}
|
3
packages/users/namespaced/UnixApi.Shadow.pp
Normal file
3
packages/users/namespaced/UnixApi.Shadow.pp
Normal file
@ -0,0 +1,3 @@
|
||||
unit UnixApi.Shadow;
|
||||
{$DEFINE FPC_DOTTEDUNITS}
|
||||
{$i shadow.pp}
|
3
packages/users/namespaced/UnixApi.Users.pp
Normal file
3
packages/users/namespaced/UnixApi.Users.pp
Normal file
@ -0,0 +1,3 @@
|
||||
unit UnixApi.Users;
|
||||
{$DEFINE FPC_DOTTEDUNITS}
|
||||
{$i users.pp}
|
7
packages/users/namespaces.lst
Normal file
7
packages/users/namespaces.lst
Normal file
@ -0,0 +1,7 @@
|
||||
src/crypth.pp=namespaced/UnixApi.Crypth.pp
|
||||
{s*:src/}=namespaced/
|
||||
{i+:src/}
|
||||
src/pwd.pp=namespaced/UnixApi.Pwd.pp
|
||||
src/shadow.pp=namespaced/UnixApi.Shadow.pp
|
||||
src/users.pp=namespaced/UnixApi.Users.pp
|
||||
src/grp.pp=namespaced/UnixApi.Grp.pp
|
@ -1,8 +1,14 @@
|
||||
{$IFNDEF FPC_DOTTEDUNITS}
|
||||
unit crypth;
|
||||
{$ENDIF FPC_DOTTEDUNITS}
|
||||
|
||||
interface
|
||||
|
||||
{$IFDEF FPC_DOTTEDUNITS}
|
||||
uses UnixApi.Base,System.InitC;
|
||||
{$ELSE FPC_DOTTEDUNITS}
|
||||
uses BaseUnix,initc;
|
||||
{$ENDIF FPC_DOTTEDUNITS}
|
||||
|
||||
{$ifdef Linux}{$linklib crypt}{$endif}
|
||||
|
||||
@ -11,4 +17,4 @@ Const libname ={$ifdef Linux}'crypt'{$else}clib{$endif};
|
||||
function crypt(key,salt:PAnsiChar):PAnsiChar;cdecl; external libname name 'crypt';
|
||||
|
||||
implementation
|
||||
end.
|
||||
end.
|
||||
|
@ -1,9 +1,16 @@
|
||||
{$IFNDEF FPC_DOTTEDUNITS}
|
||||
unit grp;
|
||||
{$ENDIF FPC_DOTTEDUNITS}
|
||||
|
||||
interface
|
||||
|
||||
{$IFDEF FPC_DOTTEDUNITS}
|
||||
uses
|
||||
System.InitC,UnixApi.Types,UnixApi.Base,System.CTypes;
|
||||
{$ELSE FPC_DOTTEDUNITS}
|
||||
uses
|
||||
initc,unixtype,baseunix,ctypes;
|
||||
{$ENDIF FPC_DOTTEDUNITS}
|
||||
|
||||
{$IFDEF FPC}
|
||||
{$PACKRECORDS C}
|
||||
|
@ -1,9 +1,16 @@
|
||||
{$IFNDEF FPC_DOTTEDUNITS}
|
||||
unit pwd;
|
||||
{$ENDIF FPC_DOTTEDUNITS}
|
||||
|
||||
interface
|
||||
|
||||
{$IFDEF FPC_DOTTEDUNITS}
|
||||
uses
|
||||
System.InitC,UnixApi.Types,UnixApi.Base,System.CTypes;
|
||||
{$ELSE FPC_DOTTEDUNITS}
|
||||
uses
|
||||
initc,unixtype,baseunix,ctypes;
|
||||
{$ENDIF FPC_DOTTEDUNITS}
|
||||
|
||||
{$IFDEF FPC}
|
||||
{$PACKRECORDS C}
|
||||
|
@ -1,4 +1,6 @@
|
||||
{$IFNDEF FPC_DOTTEDUNITS}
|
||||
unit shadow;
|
||||
{$ENDIF FPC_DOTTEDUNITS}
|
||||
interface
|
||||
|
||||
{
|
||||
|
@ -1,8 +1,14 @@
|
||||
{$IFNDEF FPC_DOTTEDUNITS}
|
||||
unit users;
|
||||
{$ENDIF FPC_DOTTEDUNITS}
|
||||
|
||||
Interface
|
||||
{$mode delphi}
|
||||
{$IFDEF FPC_DOTTEDUNITS}
|
||||
uses UnixApi.Types,UnixApi.Base,UnixApi.Pwd,UnixApi.Grp, {$ifdef Linux} UnixApi.Shadow,{$endif}System.SysUtils,System.Classes;
|
||||
{$ELSE FPC_DOTTEDUNITS}
|
||||
uses UnixType,BaseUnix,pwd,grp, {$ifdef Linux} shadow,{$endif}SysUtils,Classes;
|
||||
{$ENDIF FPC_DOTTEDUNITS}
|
||||
|
||||
Type
|
||||
EUserLookupError = Class(Exception);
|
||||
@ -64,7 +70,7 @@ EShadowNotPermitted = 'Not enough permissions to access shadow password file';
|
||||
Function getpwnam(Const UserName: AnsiString) : PPasswordRecord;
|
||||
|
||||
begin
|
||||
Result:=pwd.fpgetpwnam(PAnsiChar(UserName));
|
||||
Result:={$IFDEF FPC_DOTTEDUNITS}UnixApi.{$ENDIF}Pwd.fpgetpwnam(PAnsiChar(UserName));
|
||||
end;
|
||||
|
||||
Procedure GetUserData(Const UserName : AnsiString; Var Data : TPasswordRecord);
|
||||
@ -179,7 +185,7 @@ end;
|
||||
Function getgrnam(Const GroupName: AnsiString) : PGroup;
|
||||
|
||||
begin
|
||||
Result:=grp.fpgetgrnam(PAnsiChar(GroupName));
|
||||
Result:={$IFDEF FPC_DOTTEDUNITS}UnixApi.{$ENDIF}Grp.fpgetgrnam(PAnsiChar(GroupName));
|
||||
end;
|
||||
|
||||
Procedure GetGroupData(Const GroupName : AnsiString; Var Data : TGroup); overload;
|
||||
@ -294,13 +300,13 @@ end;
|
||||
function getspnam(UserName : AnsiString): PPasswordFileEntry;
|
||||
|
||||
begin
|
||||
result:=shadow.getspnam(PAnsiChar(UserName));
|
||||
result:={$IFDEF FPC_DOTTEDUNITS}UnixApi.{$ENDIF}Shadow.getspnam(PAnsiChar(UserName));
|
||||
end;
|
||||
|
||||
function sgetspent(Line : AnsiString): PPasswordFileEntry;
|
||||
|
||||
begin
|
||||
Result:=shadow.sgetspent(PAnsiChar(Line));
|
||||
Result:={$IFDEF FPC_DOTTEDUNITS}UnixApi.{$ENDIF}shadow.sgetspent(PAnsiChar(Line));
|
||||
end;
|
||||
|
||||
Procedure GetUserShadowData(Const UserName : AnsiString; Var Data : TPasswordFileEntry);
|
||||
|
Loading…
Reference in New Issue
Block a user