jaredhendrickson13 / pfsense-automator

pfSense Automator - a command line tool to make pfSense configurations
18 stars 4 forks source link

Traceback thrown when user does not have necessary UI permissions #10

Closed jaredhendrickson13 closed 4 years ago

jaredhendrickson13 commented 4 years ago

There is no check to see whether or not the user has permission to run a certain command or access a certain page:

python3 pfsense-automator.py test.jh.co --read-aliases -a -u admin -p pfsense
Traceback (most recent call last):
  File "pfsense-automator.py", line 1611, in <module>
    main()
  File "pfsense-automator.py", line 1337, in main
    getAliasData = get_firewall_aliases(pfsenseServer, user, key)    # Get our alias data dictionary
  File "pfsense-automator.py", line 877, in get_firewall_aliases
    name = getAliasIdInfo["text"].split("<input class=\"form-control\" name=\"name\" id=\"name\" type=\"text\" value=\"")[1].split("\"")[0]    # Save our alias name
IndexError: list index out of range

A check to should be put in place and a proper error should be thrown if user does not obtain permissions to the run the task.

jaredhendrickson13 commented 4 years ago

Issue fixed in commit b24ceb5d98c0914dfededf49348ce55c1c6a060b. Will be released in v0.0.3.