Skip to content

Backport-4.6: disallow setting of readonly/internal parameters via mavftp #30046

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: ArduPilot-4.6
Choose a base branch
from

Conversation

peterbarker
Copy link
Contributor

@peterbarker peterbarker commented May 12, 2025

Original PR is here: #29988

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR backports changes to disallow setting of readonly/internal parameters via the MAVFTP interface. The changes centralize validation logic through a new method and update related components and tests accordingly.

  • Updated the GCS_MAVLink parameter handler to use allow_set_via_mavlink().
  • Added the allow_set_via_mavlink() method to AP_Param classes to control access via MAVLink.
  • Modified the filesystem parameter upload and added an automated test to ensure readonly parameters cannot be overwritten.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
libraries/GCS_MAVLink/GCS_Param.cpp Replaced legacy internal flag check with allow_set_via_mavlink() to enforce set rules.
libraries/AP_Param/AP_Param.h Declared the new allow_set_via_mavlink() method.
libraries/AP_Param/AP_Param.cpp Defined allow_set_via_mavlink() to combine readonly and internal checks.
libraries/AP_Filesystem/AP_Filesystem_Param.cpp Applied allow_set_via_mavlink() check in filesystem parameter uploads.
Tools/autotest/arducopter.py Added test ReadOnlyDefaults to verify readonly parameter enforcement via MAVFTP.
Comments suppressed due to low confidence (1)

Tools/autotest/arducopter.py:12189

  • [nitpick] Consider renaming ReadOnlyDefaults to follow Python's snake_case naming convention (e.g. test_read_only_defaults) to maintain consistency with the project style.
def ReadOnlyDefaults(self):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant