opentechinstitute / luci-commotion

Commotion configuration pages for the LuCI web interface
GNU General Public License v3.0
11 stars 17 forks source link

fix ssid input validation #434

Closed dismantl closed 9 years ago

dismantl commented 9 years ago

fixes https://github.com/opentechinstitute/luci-commotion/issues/415

jheretic commented 9 years ago

This works on a configured node, but if you try and enter in a blank mesh network name during setup_wizard, it bombs out with a white screen and "The CGI process did not produce any response." Entering a blank AP SSID during setup_wizard correctly provides the intended error.

dismantl commented 9 years ago

just added fix for that, confirmed working for me.

jheretic commented 9 years ago

I still get the same error on setup_wizard.

dismantl commented 9 years ago

Any suggestions, @elationfoundation?

seamustuohy commented 9 years ago

Ohhhhh, you are playing with fire here. I did a good ammount of cross value checking and usage on these pages (against my own better judgement) so I would check for other cross value dependencies that could be receiving that empty value and erroring out when they parse it.

The error could be occuring when the network value is attempting to work with the name value in nwk:parse function. I would add some logging to that function to see if that is where it is erroring out.

It could also be erroring out in the check_name function when local clean_name = encode.uci(value)` (value was the name formvalue passed to it). I don't have a commotion node anymore so I can only dig through the code to check.

Hope this helps.

dismantl commented 9 years ago

Thanks. I think I've narrowed it down to a check name ~= nil, which is not the same as checking against an empty string. Hopefully that will take care of it.

jheretic commented 9 years ago

Seems to fix it for me.