Skip to content

geoip-shell reset runs destructive actions without confirmation #70

@merquel

Description

@merquel

Hi, and first of all thanks for sharing this great and very well documented project!

Issue

The argument geoip-shell reset performs destructive actions with no warning or confirmation prompt.

reset)
rm_iplists_rules
rm_all_data
[ -f "$conf_file" ] && { printf '%s\n' "Deleting the config file '$conf_file'..."; rm -f "$conf_file"; }
rm_setupdone
die 0 ;;

Because reset/restore are easy to confuse, it’s possible to wipe the config by running the wrong action (don't ask me how I know this :D).

Steps to reproduce

  1. Configure geoip-shell
  2. Run geoip-shell reset
  3. Observe it immediately wipes geoip rules and config without asking.

Proposed change

Add a safeguard against accidental execution:

Are you sure you wish to reset geoip config and firewall geoip rules? (y/N)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions