Skip to content

Commit

Permalink
Fixing Issue #4831 - SSL Default for Cactid
Browse files Browse the repository at this point in the history
Cactid lacks a default for $database_ssl
  • Loading branch information
TheWitness committed Jun 17, 2022
1 parent e0c7124 commit acf86ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Cacti CHANGELOG
-issue#4819: Domains based LDAP and AD Fullname and Email not auto-populated
-issue#4822: Cacti polling and boost report the wrong number of Data Sources when Devices are disabled
-issue#4823: When editing Graph Template Items there are cases where VDEF's are hidden when they should be shown
-issue#4831: Cactid lacks a default for $database_ssl
-feature#4820: Make it possible to only import certain components when importing packages
-feature#4825: Add update_device.php script to cli folder

Expand Down
1 change: 1 addition & 0 deletions cactid.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ function db_check_reconnect() {
if (!isset($database_ssl_key)) $database_ssl_key = false;
if (!isset($database_ssl_cert)) $database_ssl_cert = false;
if (!isset($database_ssl_ca)) $database_ssl_ca = false;
if (!isset($database_ssl)) $database_ssl = false;

This comment has been minimized.

Copy link
@netniV

netniV Jun 20, 2022

Member

That should have been handled in global?

This comment has been minimized.

Copy link
@TheWitness

TheWitness Jun 21, 2022

Author Member

It's doing a direct database reconnect as per the recommendation of Tony Roman. This reduces the likelihood of loosing a connection. So, it's a shim and not a full Cacti connect function.

This comment has been minimized.

Copy link
@netniV

netniV Jun 21, 2022

Member

I was more meaning that these values are set globally, but I can see that we would be including to get new values. I would double check we are using all the same database_* values and that I feel should become a function that's shared between all DB functions.

This comment has been minimized.

Copy link
@TheWitness

TheWitness Jun 21, 2022

Author Member

Totally agree. He was using an old config.php. I'll double check.

This comment has been minimized.

Copy link
@TheWitness

TheWitness Jun 21, 2022

Author Member

What I want to do is move the structure $db_var_defaults from global.php to global_arrays.php, but it's not possible due to it not being sourced at the time of definition.

The other option is to put the db_check_reconnect() function in lib/database.php. For now, I'm just going to hack in the additional two common missing defaults.

This comment has been minimized.

Copy link
@netniV

netniV Jun 21, 2022

Member

We could have yet another include, that handled configuration defaults which is included by global and for individual functions when they want to test for latest values.

This comment has been minimized.

Copy link
@TheWitness

TheWitness Jun 21, 2022

Author Member

Easier to just drop it into a $config[] variable.

This comment has been minimized.

Copy link
@netniV

netniV Jun 22, 2022

Member

I was more meaning that we have code that takes $config and parses it into the global constants if they are present. That code could be functionalised to be reused so that we aren't constantly reinventing the wheel. Not sure if I'm getting my point across properly so we can continue the discussion elsewhere if it's not making sense still.


$version = db_fetch_cell('SELECT cacti FROM version', 'cacti', false);

Expand Down

0 comments on commit acf86ab

Please sign in to comment.