8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 21:23:04 +01:00

Improve detection and/or initialisation of security database

This commit is contained in:
Paul Reeves 2024-06-18 10:19:27 +02:00
parent 9f512314fc
commit 57546294bb
2 changed files with 28 additions and 7 deletions

View File

@ -482,7 +482,7 @@ Source: {#FilesDir}\databases.conf; DestDir: {app}; Components: ClientComponent;
Source: {#FilesDir}\replication.conf; DestDir: {app}; DestName: replication.conf.default; Components: ServerComponent; Source: {#FilesDir}\replication.conf; DestDir: {app}; DestName: replication.conf.default; Components: ServerComponent;
Source: {#FilesDir}\replication.conf; DestDir: {app}; Components: ServerComponent; Flags: uninsneveruninstall onlyifdoesntexist; check: NoReplicationConfExists; Source: {#FilesDir}\replication.conf; DestDir: {app}; Components: ServerComponent; Flags: uninsneveruninstall onlyifdoesntexist; check: NoReplicationConfExists;
Source: {#FilesDir}\security{#FB_MAJOR_VER}.fdb; DestDir: {app}; Destname: security{#FB_MAJOR_VER}.fdb.empty; Components: ServerComponent; Source: {#FilesDir}\security{#FB_MAJOR_VER}.fdb; DestDir: {app}; Destname: security{#FB_MAJOR_VER}.fdb.empty; Components: ServerComponent;
Source: {#FilesDir}\security{#FB_MAJOR_VER}.fdb; DestDir: {app}; Components: ServerComponent; Flags: uninsneveruninstall onlyifdoesntexist Source: {#FilesDir}\security{#FB_MAJOR_VER}.fdb; DestDir: {app}; Components: ServerComponent; Check: ConfigureAuthentication; Flags: uninsneveruninstall onlyifdoesntexist
Source: {#FilesDir}\firebird.msg; DestDir: {app}; Components: ClientComponent; Flags: sharedfile ignoreversion Source: {#FilesDir}\firebird.msg; DestDir: {app}; Components: ClientComponent; Flags: sharedfile ignoreversion
Source: {#FilesDir}\firebird.log; DestDir: {app}; Components: ServerComponent; Flags: uninsneveruninstall skipifsourcedoesntexist external dontcopy Source: {#FilesDir}\firebird.log; DestDir: {app}; Components: ServerComponent; Flags: uninsneveruninstall skipifsourcedoesntexist external dontcopy
@ -635,6 +635,10 @@ program Setup;
// b) Debugged. // b) Debugged.
// This hopefully keeps the main script simpler to follow. // This hopefully keeps the main script simpler to follow.
const
UNDEFINED = -1;
Var Var
InstallRootDir: String; InstallRootDir: String;
FirebirdConfSaved: String; FirebirdConfSaved: String;
@ -650,6 +654,8 @@ Var
SYSDBAPassword: String; // SYSDBA password SYSDBAPassword: String; // SYSDBA password
init_secdb: integer; // Is set to UNDEFINED by default in InitializeSetup
#ifdef setuplogging #ifdef setuplogging
// Not yet implemented - leave log in %TEMP% // Not yet implemented - leave log in %TEMP%
// OkToCopyLog : Boolean; // Set when installation is complete. // OkToCopyLog : Boolean; // Set when installation is complete.
@ -741,6 +747,7 @@ begin
InitExistingInstallRecords; InitExistingInstallRecords;
AnalyzeEnvironment; AnalyzeEnvironment;
result := AnalysisAssessment; result := AnalysisAssessment;
init_secdb := UNDEFINED;
end; end;
@ -1052,7 +1059,8 @@ begin
IncrementSharedCount(Is64BitInstallMode, GetAppPath+'\security{#FB_MAJOR_VER}.fdb', false); IncrementSharedCount(Is64BitInstallMode, GetAppPath+'\security{#FB_MAJOR_VER}.fdb', false);
IncrementSharedCount(Is64BitInstallMode, GetAppPath+'\replication.conf', false); IncrementSharedCount(Is64BitInstallMode, GetAppPath+'\replication.conf', false);
InitSecurityDB; if init_secdb = 1 then
InitSecurityDB;
//Fix up conf file //Fix up conf file
UpdateFirebirdConf; UpdateFirebirdConf;

View File

@ -1180,14 +1180,27 @@ end;
function ConfigureAuthentication: boolean; 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 begin
if IsNotServerInstall then // if it is the first time we are called test for existence of the security db
Result := false if init_secdb = UNDEFINED then begin
else if FileExists(WizardDirValue + '\security{#FB_MAJOR_VER}.fdb') then
if FileExists(WizardDirValue + '\security5.fdb') then
Result := false Result := false
else 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; end;