[network-manager-libreswan/th/vpn-plugin-debug-bgo766872: 20/20] service: always read stdout/stderr of ipsec command



commit a8ad1ba8a4cdd309044f56710e8e046470bbbee0
Author: Thomas Haller <thaller redhat com>
Date:   Mon May 30 19:22:04 2016 +0200

    service: always read stdout/stderr of ipsec command
    
    We redirect stdout/stderr of the ipsec command to a pipe.
    
    That is for one done so that we can print it as our own
    logging output (and possibly disable it unless debug logging
    is enabled).
    
    It is also done, to make the command invocation silent, unless
    debug logging is enabled.
    Not redirecting unless debug logging is enabled is hence not an option,
    because then our regular output would be spammed with debugging information.
    
    However, as we create a pipe, we *must* read it and possible throw away
    the data. Otherwise, the pipe might fill up and block the process which
    wants to write to it.

 src/nm-libreswan-service.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/nm-libreswan-service.c b/src/nm-libreswan-service.c
index 531a941..a6cd9bf 100644
--- a/src/nm-libreswan-service.c
+++ b/src/nm-libreswan-service.c
@@ -1663,10 +1663,8 @@ connect_step (NMLibreswanPlugin *self, GError **error)
                g_io_channel_set_buffered (priv->channel, FALSE);
                priv->io_id = g_io_add_watch (priv->channel, G_IO_IN | G_IO_ERR | G_IO_HUP, io_cb, self);
 
-               if (_LOGD_enabled ()) {
-                       pipe_init (&priv->out, up_stdout, "OUT");
-                       pipe_init (&priv->err, up_stderr, "ERR");
-               }
+               pipe_init (&priv->out, up_stdout, "OUT");
+               pipe_init (&priv->err, up_stderr, "ERR");
                return TRUE;
 
        case CONNECT_STEP_LAST:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]