wpa_supplicant logfile ignored if syslog specified
diff mbox series

Message ID 089E7295-3D84-43E5-9B07-07C09B78C05C@svenyonson.com
State New
Headers show
Series
  • wpa_supplicant logfile ignored if syslog specified
Related show

Commit Message

Steve Johnson March 5, 2019, 8:18 p.m. UTC
When wpa_supplicant is invoked via ifup and a logfile is specified in /etc/network/interfaces, the correct logfile switch is generated, but /etc/wpa_supplicant/functions.sh always includes "-s" (syslog) as a default option. When both -f and -s are present, the logfile is opened but never written to and debug output instead goes to syslog.

I'm not sure if this is the proper fix, but it is working in my case.

Comments

Steve Johnson March 5, 2019, 8:37 p.m. UTC | #1
Forgot to include /etc/network/interfaces:

auto wlp2s0
iface wlp2s0 inet dhcp
	wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
	wpa-debug-level 1
	wpa-logfile /var/log/wpa_supplicant.log


> On Mar 5, 2019, at 1:18 PM, Steve Johnson <steve@svenyonson.com> wrote:
> 
> When wpa_supplicant is invoked via ifup and a logfile is specified in /etc/network/interfaces, the correct logfile switch is generated, but /etc/wpa_supplicant/functions.sh always includes "-s" (syslog) as a default option. When both -f and -s are present, the logfile is opened but never written to and debug output instead goes to syslog.
> 
> I'm not sure if this is the proper fix, but it is working in my case.
> 
> 
> diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
> index e0ee553..6150c1a 100644
> --- a/wpa_supplicant/wpa_supplicant.c
> +++ b/wpa_supplicant/wpa_supplicant.c
> @@ -6264,10 +6264,12 @@ struct wpa_global * wpa_supplicant_init(struct wpa_params *params)
> 
>        if (params->wpa_debug_file_path)
>                wpa_debug_open_file(params->wpa_debug_file_path);
> -       else
> +       else {
>                wpa_debug_setup_stdout();
> -       if (params->wpa_debug_syslog)
> -               wpa_debug_open_syslog();
> +               // only open syslog if logfile not specified
> +               if (params->wpa_debug_syslog)
> +                       wpa_debug_open_syslog();
> +       }
>        if (params->wpa_debug_tracing) {
>                ret = wpa_debug_open_linux_tracing();
>                if (ret) {
>

Patch
diff mbox series

diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index e0ee553..6150c1a 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -6264,10 +6264,12 @@  struct wpa_global * wpa_supplicant_init(struct wpa_params *params)
 
        if (params->wpa_debug_file_path)
                wpa_debug_open_file(params->wpa_debug_file_path);
-       else
+       else {
                wpa_debug_setup_stdout();
-       if (params->wpa_debug_syslog)
-               wpa_debug_open_syslog();
+               // only open syslog if logfile not specified
+               if (params->wpa_debug_syslog)
+                       wpa_debug_open_syslog();
+       }
        if (params->wpa_debug_tracing) {
                ret = wpa_debug_open_linux_tracing();
                if (ret) {