mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 12:19:18 +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;
|
unit crypth;
|
||||||
|
{$ENDIF FPC_DOTTEDUNITS}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
|
{$IFDEF FPC_DOTTEDUNITS}
|
||||||
|
uses UnixApi.Base,System.InitC;
|
||||||
|
{$ELSE FPC_DOTTEDUNITS}
|
||||||
uses BaseUnix,initc;
|
uses BaseUnix,initc;
|
||||||
|
{$ENDIF FPC_DOTTEDUNITS}
|
||||||
|
|
||||||
{$ifdef Linux}{$linklib crypt}{$endif}
|
{$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';
|
function crypt(key,salt:PAnsiChar):PAnsiChar;cdecl; external libname name 'crypt';
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
end.
|
end.
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
|
{$IFNDEF FPC_DOTTEDUNITS}
|
||||||
unit grp;
|
unit grp;
|
||||||
|
{$ENDIF FPC_DOTTEDUNITS}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
|
{$IFDEF FPC_DOTTEDUNITS}
|
||||||
|
uses
|
||||||
|
System.InitC,UnixApi.Types,UnixApi.Base,System.CTypes;
|
||||||
|
{$ELSE FPC_DOTTEDUNITS}
|
||||||
uses
|
uses
|
||||||
initc,unixtype,baseunix,ctypes;
|
initc,unixtype,baseunix,ctypes;
|
||||||
|
{$ENDIF FPC_DOTTEDUNITS}
|
||||||
|
|
||||||
{$IFDEF FPC}
|
{$IFDEF FPC}
|
||||||
{$PACKRECORDS C}
|
{$PACKRECORDS C}
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
|
{$IFNDEF FPC_DOTTEDUNITS}
|
||||||
unit pwd;
|
unit pwd;
|
||||||
|
{$ENDIF FPC_DOTTEDUNITS}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
|
{$IFDEF FPC_DOTTEDUNITS}
|
||||||
|
uses
|
||||||
|
System.InitC,UnixApi.Types,UnixApi.Base,System.CTypes;
|
||||||
|
{$ELSE FPC_DOTTEDUNITS}
|
||||||
uses
|
uses
|
||||||
initc,unixtype,baseunix,ctypes;
|
initc,unixtype,baseunix,ctypes;
|
||||||
|
{$ENDIF FPC_DOTTEDUNITS}
|
||||||
|
|
||||||
{$IFDEF FPC}
|
{$IFDEF FPC}
|
||||||
{$PACKRECORDS C}
|
{$PACKRECORDS C}
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
|
{$IFNDEF FPC_DOTTEDUNITS}
|
||||||
unit shadow;
|
unit shadow;
|
||||||
|
{$ENDIF FPC_DOTTEDUNITS}
|
||||||
interface
|
interface
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,14 @@
|
|||||||
|
{$IFNDEF FPC_DOTTEDUNITS}
|
||||||
unit users;
|
unit users;
|
||||||
|
{$ENDIF FPC_DOTTEDUNITS}
|
||||||
|
|
||||||
Interface
|
Interface
|
||||||
{$mode delphi}
|
{$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;
|
uses UnixType,BaseUnix,pwd,grp, {$ifdef Linux} shadow,{$endif}SysUtils,Classes;
|
||||||
|
{$ENDIF FPC_DOTTEDUNITS}
|
||||||
|
|
||||||
Type
|
Type
|
||||||
EUserLookupError = Class(Exception);
|
EUserLookupError = Class(Exception);
|
||||||
@ -64,7 +70,7 @@ EShadowNotPermitted = 'Not enough permissions to access shadow password file';
|
|||||||
Function getpwnam(Const UserName: AnsiString) : PPasswordRecord;
|
Function getpwnam(Const UserName: AnsiString) : PPasswordRecord;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=pwd.fpgetpwnam(PAnsiChar(UserName));
|
Result:={$IFDEF FPC_DOTTEDUNITS}UnixApi.{$ENDIF}Pwd.fpgetpwnam(PAnsiChar(UserName));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure GetUserData(Const UserName : AnsiString; Var Data : TPasswordRecord);
|
Procedure GetUserData(Const UserName : AnsiString; Var Data : TPasswordRecord);
|
||||||
@ -179,7 +185,7 @@ end;
|
|||||||
Function getgrnam(Const GroupName: AnsiString) : PGroup;
|
Function getgrnam(Const GroupName: AnsiString) : PGroup;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=grp.fpgetgrnam(PAnsiChar(GroupName));
|
Result:={$IFDEF FPC_DOTTEDUNITS}UnixApi.{$ENDIF}Grp.fpgetgrnam(PAnsiChar(GroupName));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure GetGroupData(Const GroupName : AnsiString; Var Data : TGroup); overload;
|
Procedure GetGroupData(Const GroupName : AnsiString; Var Data : TGroup); overload;
|
||||||
@ -294,13 +300,13 @@ end;
|
|||||||
function getspnam(UserName : AnsiString): PPasswordFileEntry;
|
function getspnam(UserName : AnsiString): PPasswordFileEntry;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
result:=shadow.getspnam(PAnsiChar(UserName));
|
result:={$IFDEF FPC_DOTTEDUNITS}UnixApi.{$ENDIF}Shadow.getspnam(PAnsiChar(UserName));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function sgetspent(Line : AnsiString): PPasswordFileEntry;
|
function sgetspent(Line : AnsiString): PPasswordFileEntry;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=shadow.sgetspent(PAnsiChar(Line));
|
Result:={$IFDEF FPC_DOTTEDUNITS}UnixApi.{$ENDIF}shadow.sgetspent(PAnsiChar(Line));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure GetUserShadowData(Const UserName : AnsiString; Var Data : TPasswordFileEntry);
|
Procedure GetUserShadowData(Const UserName : AnsiString; Var Data : TPasswordFileEntry);
|
||||||
|
Loading…
Reference in New Issue
Block a user