]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
browser-system: Use more robust mechanism for starting browser
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 6 Oct 2014 15:50:00 +0000 (18:50 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 9 Oct 2014 14:38:25 +0000 (17:38 +0300)
Use os_exec() to run the external browser to avoid undesired command
line processing for control interface event strings. Previously, it
could have been possible for some of the event strings to include
unsanitized data which is not suitable for system() use.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/utils/browser-system.c

index 2884d341de0a697e24e940aacc904db840dd7649..a080e2cb904e5d7cfe016521f67384aa3af86472 100644 (file)
@@ -92,7 +92,7 @@ int hs20_web_browser(const char *url)
                return -1;
        }
 
-       if (system(cmd) != 0) {
+       if (os_exec("/usr/bin/x-www-browser", url, 0) != 0) {
                wpa_printf(MSG_INFO, "Failed to launch browser");
                eloop_cancel_timeout(browser_timeout, NULL, NULL);
                http_server_deinit(http);