Project

General

Profile

Actions

Bug #11582

closed

FreeRADIUS XML-RPC Sync doesn't sync all configuration sections

Added by Alexis Mestag about 3 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Viktor Gurov
Category:
FreeRADIUS
Target version:
-
Start date:
03/01/2021
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:

Description

Using the XML-RPC Sync feature of the FreeRADIUS package doesn't sync all configuration sections.

For example:
  • tab Users is correctly synced.
  • tab MACs is correctly synced.
  • tab NAS / Clients is correctly synced.
But the following tabs are not synced to the backup server:
  • Interfaces
  • Settings
  • EAP

(I did not test the other tabs.)

I did some digging into the FreeRADIUS package source code, and found the following (some code is omitted):

function freeradius_do_xmlrpc_sync($sync_to_ip, $username, $password, $varsyncport, $varsyncprotocol, $varsynctimeout) {
    // [... some omitted code ...]

    /* XML will hold the sections to sync. */
    $xml = array();
    $xml['freeradius'] = $config['installedpackages']['freeradius'];
    $xml['freeradiusauthorizedmacs'] = $config['installedpackages']['freeradiusauthorizedmacs'];
    $xml['freeradiusclients'] = $config['installedpackages']['freeradiusclients'];

    $execcmd  = "require_once('/usr/local/pkg/freeradius.inc');\n";
    $execcmd .= "freeradius_all_after_XMLRPC_resync();";

    // [... some omitted code ...]
}

So the behavior matches the code.
This method synchronizes only the sections :
  • freeradius
  • freeradiusauthorizedmacs (which holds settings from the MACs tab)
  • freeradiusclients (which holds settings from the NAS / Clients tab)
and omits the sections :
  • freeradiuseapconf (which holds settings from the EAP tab)
  • freeradiusinterfaces (which holds settings from the Interfaces tab)
  • freeradiusinterfaces (which holds settings from the Settings tab)
  • freeradiussync (this one I understand why it's omitted: in order to avoid a sync loop)

I manually edited the source code to make it sync the missing sections, and it seems to work well (at least, the configuration is well-synced).
It there a reason why these 3 sections (freeradiuseapconf, freeradiusinterfaces, freeradiusinterfaces) are omitted from the synchronization mechanism ?


Files

63.diff (1.12 KB) 63.diff Viktor Gurov, 03/02/2021 05:04 AM
69.diff (1.87 KB) 69.diff Viktor Gurov, 03/09/2021 02:15 AM
Actions

Also available in: Atom PDF