8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 16:43:03 +01:00

Improve detection of existing configured security database

This commit is contained in:
Paul Reeves 2024-06-21 11:42:07 +02:00
parent 4449d55c73
commit dccbd66202
2 changed files with 27 additions and 6 deletions

View File

@ -635,6 +635,10 @@ program Setup;
// b) Debugged.
// This hopefully keeps the main script simpler to follow.
const
UNDEFINED = -1;
Var
InstallRootDir: String;
FirebirdConfSaved: String;
@ -650,6 +654,8 @@ Var
SYSDBAPassword: String; // SYSDBA password
init_secdb: integer; // Is set to UNDEFINED by default in InitializeSetup
#ifdef setuplogging
// Not yet implemented - leave log in %TEMP%
// OkToCopyLog : Boolean; // Set when installation is complete.
@ -741,6 +747,7 @@ begin
InitExistingInstallRecords;
AnalyzeEnvironment;
result := AnalysisAssessment;
init_secdb := UNDEFINED;
end;
@ -1052,7 +1059,8 @@ begin
IncrementSharedCount(Is64BitInstallMode, GetAppPath+'\security{#FB_MAJOR_VER}.fdb', false);
IncrementSharedCount(Is64BitInstallMode, GetAppPath+'\replication.conf', false);
InitSecurityDB;
if init_secdb = 1 then
InitSecurityDB;
//Fix up conf file
UpdateFirebirdConf;

View File

@ -1480,14 +1480,27 @@ end;
function ConfigureAuthentication: boolean;
// This function should only be called once - when the innosetup installer tries to
// install the secdb. If it is called a second time it will always find the secdb
// exists, even if it hasn't been configured. The only real way to test whether we
// should configure authentication is to actually _open_ a database and read the
// sec$users table. Except we cannot do that as we need this information before we
// install the files needed to read the database.
begin
if IsNotServerInstall then
Result := false
else
if FileExists(WizardDirValue + '\security6.fdb') then
// if it is the first time we are called test for existence of the security db
if init_secdb = UNDEFINED then begin
if FileExists(WizardDirValue + '\security{#FB_MAJOR_VER}.fdb') then
Result := false
else
Result := true;
Result := true
end
else
// else the result is the current setting of init_secdb
Result := Boolean(init_secdb);
// Whatever the result, cast it to an integer and update init_secdb
init_secdb := Integer(Result);
end;