Unexpected behaviour running a cluster restore with use_sudo_for_restore
set to false in medusa.ini
#729
Labels
bug
Something isn't working
complexity: low
good first issue
Good for newcomers
help-wanted
Issues in the state 'help-wanted'
Project board link
Issue Summary:
When attempting to perform cluster restore with
use_sudo_for_restore
set to false, the restore-node command is still executed with sudo privileges due to an incorrect conditional check. This behaviour deviates from expected functionality and could lead to unsuccessful backups and security concerns.Steps to Reproduce:
medusa.ini
configuration.Expected Behaviour:
The restore-node command should not be executed with sudo privileges when use_sudo_for_restore is set to false, ensuring consistency with the configuration option.
Actual Behavior:
The restore-node command is still executed with sudo privileges, irrespective of the value of use_sudo_for_restore.
Additional Context:
Upon reviewing the codebase, it appears that the conditional check used to determine whether the restore-node command should run with sudo privileges checks
config.cassandra.use_sudo
instead ofuse_sudo_for_restore
, which is the variable used for medusa running as sudo for the majority of commands, but should not be able to overrideuse_sudo_for_restore
. This discrepancy leads to the observed behaviour.Proposed Solution:
Adjust the conditional check in the codebase to properly utilise the
use_sudo_for_restore
configuration option when determining whether the restore-node command should run with sudo privileges.Impact:
This issue affects users who rely on the use_sudo_for_restore configuration option to control sudo usage during cluster backup operations. Resolving this issue will ensure consistent behavior and improve security by correctly respecting user configurations.
Environment:
medusa.ini
Storage Details:┆Issue is synchronized with this Jira Story by Unito
┆Issue Number: MED-15
The text was updated successfully, but these errors were encountered: