Skip to content

Commit

Permalink
Prevent potential security issue with self-signed GIT certificate.
Browse files Browse the repository at this point in the history
  • Loading branch information
LongDirtyAnimAlf committed Dec 24, 2024
1 parent 23d86e6 commit ea1e6a5
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 21 deletions.
2 changes: 1 addition & 1 deletion public/gitrevision.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[master]darwin_amd64_crossbins_all-2915(62e43ed)
[master]darwin_amd64_crossbins_all-2916(23d86e6)
16 changes: 11 additions & 5 deletions sources/gitclient.pas
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ procedure TGitClient.SetDesiredTag(AValue: string);
ExportOnly:=(Length(DesiredTag)>0);
end;



procedure TGitClient.CheckOut(UseForce:boolean=false);
// SVN checkout is more or less equivalent to git clone
var
Expand Down Expand Up @@ -451,9 +449,17 @@ procedure TGitClient.Init;
// Message: "SSL certificate problem: self signed certificate in certificate chain"
if (Pos('SSL certificate problem',Output)>0) then
begin
// Disable SSL verification
Command := ' config --local http.sslVerify false';
FReturnCode := TInstaller(Parent).ExecuteCommandInDir(DoubleQuoteIfNeeded(FRepoExecutable) + Command, LocalRepository, Output, Verbose);
// Never disable ssl on these sites !!
if (AnsiStartsStr('https://gitlab.com',Repository) OR AnsiStartsStr('https://github.com',Repository) OR AnsiContainsStr(Repository,'git.sourceforge.net')) then
begin
FReturnCode := AbortedExitCode;
exit;
end
else
begin
Command := ' config --local http.sslVerify false';
FReturnCode := TInstaller(Parent).ExecuteCommandInDir(DoubleQuoteIfNeeded(FRepoExecutable) + Command, LocalRepository, Output, Verbose);
end;
end;
end;
end;
Expand Down
29 changes: 19 additions & 10 deletions sources/installerlazarus.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2688,6 +2688,7 @@ function CreateQT5Symlinks(aApp:string):boolean;
{$IF DEFINED(LCLQt5) OR DEFINED(LCLQt6)}

// Adjust fpc.cfg
// Windows to be done
FPCConfig:=TStringList.Create;
try
FPCConfig.LoadFromFile(GetFPCConfigPath(FPCCONFIGFILENAME));
Expand Down Expand Up @@ -2718,25 +2719,33 @@ function CreateQT5Symlinks(aApp:string):boolean;
QTConfig.Append('#IFNDEF FPC_CROSSCOMPILING');
QTConfig.Append('# Adding some standard paths for QT locations ... bit dirty, but works ... ;-)');
{$ifdef Darwin}
ConfigText.Append('-Fl'+IncludeTrailingPathDelimiter(BaseDirectory)+'Frameworks');
ConfigText.Append('-k-F'+IncludeTrailingPathDelimiter(BaseDirectory)+'Frameworks');
//For runtime
ConfigText.Append('-k-rpath');
ConfigText.Append('-k@executable_path/../Frameworks');
ConfigText.Append('-k-rpath');
ConfigText.Append('-k'+IncludeTrailingPathDelimiter(BaseDirectory)+'Frameworks');
{$else Darwin}
s:=IncludeTrailingPathDelimiter(BaseDirectory)+'Frameworks';
if DirectoryExists(s) then
begin
QTConfig.Append('-Fl'+s);
QTConfig.Append('-k-F'+s);
QTConfig.Append('-k-rpath');
QTConfig.Append('-k'+s);
//For Lazarus runtime
QTConfig.Append('-k-rpath');
QTConfig.Append('-k@executable_path/../Frameworks');
end;
//For any runtime
QTConfig.Append('-k-rpath');
QTConfig.Append('-k@executable_path');
{$endif Darwin}
{$ifdef Unix}
if (QTTrickeryNeeded AND (FileExists(IncludeTrailingPathDelimiter(InstallDirectory)+QTLibs))) then
QTConfig.Append('-Fl'+InstallDirectory)
else
if LibWhich(QTLibs,s) then
QTConfig.Append('-Fl'+ExcludeTrailingPathDelimiter(s));
//For runtime
{$ifndef Darwin}
//For any runtime
QTConfig.Append('-k-rpath');
QTConfig.Append('-k$ORIGIN');
{$endif Unix}
{$endif Darwin}
{$endif Unix}
QTConfig.Append('#ENDIF');
QTConfig.Append(QTMAGICEND);
QTConfig.Append('');
Expand Down
15 changes: 10 additions & 5 deletions sources/updeluxe/fpcupdeluxemainform.pas
Original file line number Diff line number Diff line change
Expand Up @@ -4518,8 +4518,8 @@ function TForm1.GetFPCUPSettings(IniDirectory:string):boolean;
procedure TForm1.GetSystemInfo;
var
Cores,MemAvailable,SwapAvailable:DWord;
{$ifdef LCLQT5}
QT5LibraryLocation:string;
{$IF DEFINED(LCLQt5) OR DEFINED(LCLQt6)}
QTLibraryLocation:string;
{$endif}
begin
{$ifdef READER}
Expand All @@ -4546,11 +4546,16 @@ procedure TForm1.GetSystemInfo;
if IsLinuxMUSL then AddMessage('Seems we are running on a MUSL Linux.');
{$ENDIF LINUX}

{$IF DEFINED(LCLQt5) OR DEFINED(LCLQt6)}
{$ifdef LCLQT5}
if LibWhich(LIBQT5,QT5LibraryLocation) then
AddMessage('Found system wide '+LIBQT5+' in '+QT5LibraryLocation+'. And that will be used.')
if LibWhich(LIBQT5,QTLibraryLocation) then
{$endif}
{$ifdef LCLQT6}
if LibWhich(LIBQT6,QTLibraryLocation) then
{$endif}
AddMessage('Found system wide libQTPas in '+QTLibraryLocation+'. And that will be used.')
else
AddMessage('No system wide '+LIBQT5+' found. Some QT5 trickery will be used');
AddMessage('No system wide libQTPas found. Some QT trickery will be used');
{$endif}

Cores:=GetLogicalCpuCount;
Expand Down

0 comments on commit ea1e6a5

Please sign in to comment.