aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-12-16 17:29:38 +0100
committerChristian Grothoff <christian@grothoff.org>2019-12-16 17:29:38 +0100
commit01e118581d800cf7c1b6f03b27679b45448fb82c (patch)
tree53333f5f1087ad7f0f80cc426f8aaf6a150d0042
parent73ee949868200082b7e9131d2f410f289fd1c416 (diff)
downloadgnunet-01e118581d800cf7c1b6f03b27679b45448fb82c.tar.gz
gnunet-01e118581d800cf7c1b6f03b27679b45448fb82c.zip
enhance gnunet-qr to support passing arguments beyond just the URI to commands
-rw-r--r--src/namestore/namestore.conf.in2
-rw-r--r--src/util/gnunet-qr.c40
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
36ASYNC_COMMIT = NO 36ASYNC_COMMIT = NO
37 37
38[uri] 38[uri]
39gns = gnunet-namestore 39gns = gnunet-namestore -u
40 40
41 41
42[fcfsd] 42[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,
141 GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ), 141 GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ),
142 &maint_child_death, 142 &maint_child_death,
143 NULL); 143 NULL);
144 p = GNUNET_OS_start_process (GNUNET_NO, 144 {
145 0, 145 char **argv = NULL;
146 NULL, 146 unsigned int argc = 0;
147 NULL, 147 char *u = GNUNET_strdup (orig_uri);
148 NULL, 148
149 program, 149 GNUNET_array_append (argv,
150 program, 150 argc,
151 orig_uri, 151 GNUNET_strdup (program));
152 NULL); 152 for (const char *tok = strtok (u, " ");
153 NULL != tok;
154 tok = strtok (NULL, " "))
155 GNUNET_array_append (argv,
156 argc,
157 GNUNET_strdup (tok));
158 GNUNET_array_append (argv,
159 argc,
160 NULL);
161 p = GNUNET_OS_start_process_vap (GNUNET_NO,
162 0,
163 NULL,
164 NULL,
165 NULL,
166 program,
167 argv);
168 for (unsigned int i = 0; i<argc; i++)
169 GNUNET_free (argv[i]);
170 GNUNET_array_grow (argv,
171 argc,
172 0);
173 GNUNET_free (orig_uri);
174 }
153 GNUNET_free (program); 175 GNUNET_free (program);
154 if (NULL == p) 176 if (NULL == p)
155 GNUNET_SCHEDULER_cancel (rt); 177 GNUNET_SCHEDULER_cancel (rt);