[network-manager-openvpn/th/bgo556134_up_restart: 2/4] helper: log the command line argument for "--helper-debug"
- From: Thomas Haller <thaller src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openvpn/th/bgo556134_up_restart: 2/4] helper: log the command line argument for "--helper-debug"
- Date: Tue, 18 Mar 2014 14:47:27 +0000 (UTC)
commit f8952fd079256fc1954d9cb60c2c3d57fb4fbc4c
Author: Thomas Haller <thaller redhat com>
Date: Tue Mar 18 15:39:56 2014 +0100
helper: log the command line argument for "--helper-debug"
Signed-off-by: Thomas Haller <thaller redhat com>
src/nm-openvpn-service-openvpn-helper.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/src/nm-openvpn-service-openvpn-helper.c b/src/nm-openvpn-service-openvpn-helper.c
index 6ab56a6..c3ff6b8 100644
--- a/src/nm-openvpn-service-openvpn-helper.c
+++ b/src/nm-openvpn-service-openvpn-helper.c
@@ -558,10 +558,25 @@ main (int argc, char *argv[])
}
if (helper_debug) {
+ GString *args;
+
+ args = g_string_new (NULL);
+ for (i = 0; i < argc; i++) {
+ if (i > 0)
+ g_string_append_c (args, ' ');
+ if (shift && 1 + shift == i)
+ g_string_append (args, " ");
+ tmp = g_strescape (argv[i], NULL);
+ g_string_append_printf (args, "\"%s\"", tmp);
+ g_free (tmp);
+ }
+
+ g_message ("command line: %s", args->str);
+ g_string_free (args, TRUE);
g_message ("openvpn script environment ---------------------------");
iter = environ;
while (iter && *iter)
- g_print ("%s\n", *iter++);
+ g_message ("%s", *iter++);
g_message ("------------------------------------------------------");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]