Now switches to the user/group that owns the executable on startup.
This commit is contained in:
parent
acfb1eebf7
commit
c91a1c93cb
|
@ -337,6 +337,23 @@ Begin
|
|||
SwitchFocus;
|
||||
End;
|
||||
|
||||
{$IFDEF UNIX}
|
||||
Procedure SetUserOwner;
|
||||
Var
|
||||
Info : Stat;
|
||||
MysLoc : String;
|
||||
Begin
|
||||
MysLoc := GetEnv('mysticbbs');
|
||||
|
||||
If MysLoc <> '' Then MysLoc := DirSlash(MysLoc);
|
||||
|
||||
If fpStat(MysLoc + 'mis', Info) = 0 Then Begin
|
||||
fpSetGID (Info.st_GID);
|
||||
fpSetUID (Info.st_UID);
|
||||
End;
|
||||
End;
|
||||
{$ENDIF}
|
||||
|
||||
Function ServerStartup : Boolean;
|
||||
Begin
|
||||
Result := False;
|
||||
|
@ -393,6 +410,10 @@ Begin
|
|||
|
||||
Result := True;
|
||||
End;
|
||||
|
||||
{$IFDEF UNIX}
|
||||
SetUserOwner;
|
||||
{$ENDIF}
|
||||
End;
|
||||
|
||||
{$IFDEF UNIX}
|
||||
|
|
|
@ -182,7 +182,13 @@ Procedure Linux_Init;
|
|||
Var
|
||||
Count : Word;
|
||||
TChat : ChatRec;
|
||||
Info : Stat;
|
||||
Begin
|
||||
If fpStat('mystic', Info) = 0 Then Begin
|
||||
fpSetGID (Info.st_GID);
|
||||
fpSetUID (Info.st_UID);
|
||||
End;
|
||||
|
||||
Session.NodeNum := 0;
|
||||
|
||||
For Count := 1 to Config.INetTNNodes Do Begin
|
||||
|
|
Loading…
Reference in New Issue