[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: enhance gnunet-qr to support passing arg
From: |
gnunet |
Subject: |
[gnunet] branch master updated: enhance gnunet-qr to support passing arguments beyond just the URI to commands |
Date: |
Mon, 16 Dec 2019 17:34:40 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 01e118581 enhance gnunet-qr to support passing arguments beyond just
the URI to commands
01e118581 is described below
commit 01e118581d800cf7c1b6f03b27679b45448fb82c
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Dec 16 17:29:38 2019 +0100
enhance gnunet-qr to support passing arguments beyond just the URI to
commands
---
src/namestore/namestore.conf.in | 2 +-
src/util/gnunet-qr.c | 40 +++++++++++++++++++++++++++++++---------
2 files changed, 32 insertions(+), 10 deletions(-)
diff --git a/src/namestore/namestore.conf.in b/src/namestore/namestore.conf.in
index b5fb45abc..e6cc74aec 100644
--- a/src/namestore/namestore.conf.in
+++ b/src/namestore/namestore.conf.in
@@ -36,7 +36,7 @@ TEMPORARY_TABLE = NO
ASYNC_COMMIT = NO
[uri]
-gns = gnunet-namestore
+gns = gnunet-namestore -u
[fcfsd]
diff --git a/src/util/gnunet-qr.c b/src/util/gnunet-qr.c
index cdeea4db1..2dcfc12db 100644
--- a/src/util/gnunet-qr.c
+++ b/src/util/gnunet-qr.c
@@ -141,15 +141,37 @@ gnunet_uri (void *cls,
GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ),
&maint_child_death,
NULL);
- p = GNUNET_OS_start_process (GNUNET_NO,
- 0,
- NULL,
- NULL,
- NULL,
- program,
- program,
- orig_uri,
- NULL);
+ {
+ char **argv = NULL;
+ unsigned int argc = 0;
+ char *u = GNUNET_strdup (orig_uri);
+
+ GNUNET_array_append (argv,
+ argc,
+ GNUNET_strdup (program));
+ for (const char *tok = strtok (u, " ");
+ NULL != tok;
+ tok = strtok (NULL, " "))
+ GNUNET_array_append (argv,
+ argc,
+ GNUNET_strdup (tok));
+ GNUNET_array_append (argv,
+ argc,
+ NULL);
+ p = GNUNET_OS_start_process_vap (GNUNET_NO,
+ 0,
+ NULL,
+ NULL,
+ NULL,
+ program,
+ argv);
+ for (unsigned int i = 0; i<argc; i++)
+ GNUNET_free (argv[i]);
+ GNUNET_array_grow (argv,
+ argc,
+ 0);
+ GNUNET_free (orig_uri);
+ }
GNUNET_free (program);
if (NULL == p)
GNUNET_SCHEDULER_cancel (rt);
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: enhance gnunet-qr to support passing arguments beyond just the URI to commands,
gnunet <=