Skip to content

Conversation

@0danteh
Copy link

@0danteh 0danteh commented Jan 16, 2024

This commit introduces a new safety feature in the 'tasksel' tool to prevent accidental removal of critical system tasks. A confirmation prompt is added to the removal process for tasks that are identified as potentially harmful.

Key Changes:

  • Defined a list of critical tasks (@harmful_cmd) that are considered dangerous to remove. This list can be modified to include any task that is crucial for system stability.
  • Modified the getopts function to include a check against this list when processing a remove command. If the command involves any of these harmful tasks, the user is prompted to confirm their intention.
  • Implemented a confirmation prompt that requires explicit user approval (input 'Y') to proceed with the removal. If the user responds with 'N' or any other input, the script immediately exits, thereby stopping the removal process.
  • This feature adds an extra layer of protection against inadvertent system damage, especially for users who might not be fully aware of the consequences of removing certain tasks.

Testing:

  • Extensive testing is recommended to ensure that the new confirmation prompt behaves correctly under various scenarios and does not disrupt the intended functionality of 'tasksel'.
  • The list of harmful commands should be reviewed and updated as needed based on the specific use case and system requirements.

This change aims to enhance the usability and safety of 'tasksel', particularly in environments where accidental removal of critical tasks could lead to significant system issues.

This commit introduces a new safety feature in the 'tasksel' tool to prevent accidental removal of critical system tasks. A confirmation prompt is added to the removal process for tasks that are identified as potentially harmful.

Key Changes:
- Defined a list of critical tasks (`@harmful_cmd`) that are considered dangerous to remove. This list can be modified to include any task that is crucial for system stability.
- Modified the `getopts` function to include a check against this list when processing a `remove` command. If the command involves any of these harmful tasks, the user is prompted to confirm their intention.
- Implemented a confirmation prompt that requires explicit user approval (input 'Y') to proceed with the removal. If the user responds with 'N' or any other input, the script immediately exits, thereby stopping the removal process.
- This feature adds an extra layer of protection against inadvertent system damage, especially for users who might not be fully aware of the consequences of removing certain tasks.

Testing:
- Extensive testing is recommended to ensure that the new confirmation prompt behaves correctly under various scenarios and does not disrupt the intended functionality of 'tasksel'.
- The list of harmful commands should be reviewed and updated as needed based on the specific use case and system requirements.

This change aims to enhance the usability and safety of 'tasksel', particularly in environments where accidental removal of critical tasks could lead to significant system issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant