Project

General

Profile

Actions

Bug #14806

closed

Freeradius configuration lost when you reinstall package

Added by Paolo Rosso 7 months ago. Updated 7 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
FreeRADIUS
Target version:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Affected Version:
2.7.0
Affected Plus Version:
23.05.1
Affected Architecture:
amd64

Description

I did a simple freeradius configuration and entered a user.
If I reinstall freeradius from the package manager I lose the entire freeradius configuration, including users.

this is the output of the reinstallation of the package:

>>> Upgrading pfSense-pkg-freeradius3... 
Updating pfSense-core repository catalogue...
pfSense-core repository is up to date.
Updating pfSense repository catalogue...
pfSense repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
    pfSense-pkg-freeradius3-0.15.10 [pfSense]

Number of packages to be reinstalled: 1
[1/1] Reinstalling pfSense-pkg-freeradius3-0.15.10...
[1/1] Extracting pfSense-pkg-freeradius3-0.15.10: .......... done
Removing freeradius3 components...
Menu items... done.
Services... done.
Loading package instructions...
Deinstall commands... done.
Saving updated package information...
overwrite!
Loading package configuration... done.
Configuring package components...
Loading package instructions...
Custom commands...
Executing custom_php_install_command()...done.
Executing custom_php_resync_config_command()...done.
Menu items... done.
Services... done.
Writing configuration... done.
>>> Cleaning up cache... done.
Success

after this I no longer have any configuration on freeradius


Related issues

Related to Bug #14596: FreeRADIUS falsely shows its default is to save data during package reinstallDuplicate

Actions
Actions #1

Updated by Kris Phillips 7 months ago

  • Affected Plus Version set to 23.09

Tested this on the latest 23.09 builds. Even with "Save settings after deletion" checked, all settings are erased on reinstall. Confirmed bug.

Actions #2

Updated by Kris Phillips 7 months ago

  • Status changed from New to Confirmed
Actions #3

Updated by Jim Pingle 7 months ago

I can't replicate this here but I can see how it might have happened.

If you never went to the Settings tab and clicked Save there, then the tag for keep_settings wouldn't be present in the configuration.

When this package was updated for PHP 8.x, it changed like so:

-       if (isset($config['installedpackages']['freeradiussettings']['config'][0]['keep_settings']) &&
-           empty($config['installedpackages']['freeradiussettings']['config'][0]['keep_settings'])) {
+       if (!config_path_enabled('installedpackages/freeradiussettings/config/0/', 'keep_settings')) {

Those two tests aren't equivalent. The first tests that the tag is there at all, the second tests if it's empty or not. The new test only checks if the tag is present, which isn't sufficient.

For the old test to be true it had to be present in the config but empty, which means someone saved the settings with that option unchecked. Now it's happening both when that is true and when it's unset, which is also the case if someone had never saved the main settings tab, which shouldn't be needed if the default settings are OK.

Actions #4

Updated by Jim Pingle 7 months ago

  • Status changed from Confirmed to In Progress
  • Assignee set to Jim Pingle
Actions #5

Updated by Jim Pingle 7 months ago

  • Related to Bug #14596: FreeRADIUS falsely shows its default is to save data during package reinstall added
Actions #6

Updated by Jim Pingle 7 months ago

  • Status changed from In Progress to Feedback
  • % Done changed from 0 to 100
  • Affected Plus Version changed from 23.09 to 23.05.1

Fix committed and picked back to CE 2.7.0 and Plus 23.05.1

https://github.com/pfsense/FreeBSD-ports/commit/004892778ef6d5f25661295e2a8e9cb397687b1f

Actions #7

Updated by Paolo Rosso 7 months ago

I confirm that the <keep_settings> tag is not present in my config.xml.
After entering settings and saving, the <keep_settings> tag appeared on config.xml: value "on" when "Save settings after deletion" is checked, value "" when it is unchecked.

By reinstalling the freeradius package with <keep_settings>on</keep_settings> the configuration was not lost.

Actions #8

Updated by Jim Pingle 7 months ago

Paolo Rosso wrote in #note-7:

I confirm that the <keep_settings> tag is not present in my config.xml.
After entering settings and saving, the <keep_settings> tag appeared on config.xml: value "on" when "Save settings after deletion" is checked, value "" when it is unchecked.

By reinstalling the freeradius package with <keep_settings>on</keep_settings> the configuration was not lost.

The package available on Plus 23.05.1, CE 2.7.0 was fixed yesterday and if you reinstalled after my last update yesterday then it would have worked properly no matter how you had it set. So if you want to try it again without the main settings present, it should have the proper behavior now.

Actions #9

Updated by aleksei prokofiev 7 months ago

Tested on
23.05.1-RELEASE (amd64)
built on Wed Jun 28 03:57:27 UTC 2023
FreeBSD 14.0-CURRENT

freeradius3 0.15.10_1

After uninstalling/reinstalling freeradius, I can confirm that the settings are not deleted and are retained.

Actions #10

Updated by Jim Pingle 7 months ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF