Skip to content

fix(mactrack): small fixes to removal, stale processes, MAC actions and DNS settings - #421

Merged
TheWitness merged 7 commits into
developfrom
fix/mactrack-small-defects
Nov 12, 2026
Merged

TheWitness merged 7 commits into
developfrom
fix/mactrack-small-defects

Conversation

@somethingwithproof

Copy link
Copy Markdown
Member

Six small fixes from the issue list, one commit each. Device and site removal now bind the id instead of concatenating it. The stale-process sweep deletes the rows it found in one statement keyed on device_id, so an entry without a PID no longer takes every other PID-less entry with it, and the age check spares an entry that was re-queued in the meantime. The MAC report tells you when none of the selected addresses was valid, looks up a revoke selection in one query, and raises the group-authorization warning through raise_message() so it is actually shown. The interfaces report compares site_id with '-1' like the other reports. The DNS server settings reject anything that is not empty or an IP address, using the settings filter key (Cacti 1.2.16 and later), and accept IPv6-length values.

The CHANGELOG commit also carries the entries for #419 and #420, so only one PR in this batch edits the file. If either of those is closed, its entry should come out.

Tests cover the bound deletes, the single stale-process delete and the DNS filter; they fail on develop and pass here. The raw-SQL ratchet for mactrack_actions.php drops from 19 to 0.

Fixes #285
Fixes #288
Fixes #290
Fixes #292
Fixes #293
Fixes #295

api_mactrack_device_remove() and api_mactrack_site_remove() concatenated the id into each DELETE; bind it instead and drop the repeated mac_track_processes delete.

Fixes #288

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
clear_old_processes() deleted each entry by process_id, so an entry with no PID also removed every other entry still waiting for one. Delete the rows it found by device_id, the table key, in one statement.

Fixes #295

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Tell the user when none of the selected MAC addresses was valid, look up the whole revoke selection in one query, and raise the group-authorization warning through raise_message() so it is shown.

Fixes #290
Fixes #293

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Fixes #292

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Reject a primary or secondary DNS server that is not empty or an IP address when the settings are saved, and allow IPv6-length values.

Fixes #285

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Covers this branch and the xform_net_address() and device export branches, so only one pull request in the batch edits the CHANGELOG.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Copy the function into a temporary file and require it, so the tests no longer run code through eval().

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@sonarqubecloud

Copy link
Copy Markdown

@TheWitness
TheWitness merged commit 95e2094 into develop Nov 12, 2026
9 checks passed
@TheWitness
TheWitness deleted the fix/mactrack-small-defects branch November 12, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants