RaspAP / raspap-webgui

Simple wireless AP setup & management for Debian-based devices
https://raspap.com/
GNU General Public License v3.0
4.48k stars 794 forks source link

Use sed instead of grep+cut to capture the passphrase #1680

Closed warpdesign closed 1 month ago

warpdesign commented 1 month ago

Current method would crop any passphrase containing an = sign.

For eg. with this hostapd.conf:

... wpa_passwphrase=Foo=Bar ...

the wpa_passphrase() function would would return Foo instead of Foo=Bar, incorrectly cropping the passkey.

As a result, when editing the hotspot settings, the user may incorrectly update its passkey without even knowing it. Luckily, mine was cropped to a too short string, so I noticed the error in the form.

I tested the new command with macOS & Linux (Debian) so I guess it should work with most Unix OS.

Also, I guess the problem can happen in other places, like maybe with the ssid (can it contain = signs?).

billz commented 1 month ago

@NL-TCH

NL-TCH commented 1 month ago

good catch @warpdesign, thanks for the PR!

@billz good to merge from my side

NL-TCH commented 1 month ago

we might need to update other variables as well, now the "=" sign is nowhere allowed (for example in SSID-names and Interfaces))