diff options
author | ng0 <ng0@n0.is> | 2019-09-08 12:33:09 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-09-08 12:33:09 +0000 |
commit | d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb (patch) | |
tree | 9efd18ea7d425652085ed0bd5e8e45604bc5f6b9 /src/gns/gnunet-gns-import.c | |
parent | a0fce305c565c0937d917a92712f15e9c5736260 (diff) | |
download | gnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.tar.gz gnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.zip |
uncrustify as demanded.
Diffstat (limited to 'src/gns/gnunet-gns-import.c')
-rw-r--r-- | src/gns/gnunet-gns-import.c | 387 |
1 files changed, 196 insertions, 191 deletions
diff --git a/src/gns/gnunet-gns-import.c b/src/gns/gnunet-gns-import.c index 5e3560313..82710b803 100644 --- a/src/gns/gnunet-gns-import.c +++ b/src/gns/gnunet-gns-import.c | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file gnunet-gns.c | 21 | * @file gnunet-gns.c |
22 | * @brief binary version of gnunet-gns-import.sh | 22 | * @brief binary version of gnunet-gns-import.sh |
@@ -86,13 +86,13 @@ static int ret; | |||
86 | 86 | ||
87 | 87 | ||
88 | static int | 88 | static int |
89 | run_process_and_wait (int pipe_control, | 89 | run_process_and_wait(int pipe_control, |
90 | enum GNUNET_OS_InheritStdioFlags std_inheritance, | 90 | enum GNUNET_OS_InheritStdioFlags std_inheritance, |
91 | struct GNUNET_DISK_PipeHandle *pipe_stdin, | 91 | struct GNUNET_DISK_PipeHandle *pipe_stdin, |
92 | struct GNUNET_DISK_PipeHandle *pipe_stdout, | 92 | struct GNUNET_DISK_PipeHandle *pipe_stdout, |
93 | enum GNUNET_OS_ProcessStatusType *st, | 93 | enum GNUNET_OS_ProcessStatusType *st, |
94 | unsigned long *code, | 94 | unsigned long *code, |
95 | const char *filename, ...) | 95 | const char *filename, ...) |
96 | { | 96 | { |
97 | static struct GNUNET_OS_Process *p; | 97 | static struct GNUNET_OS_Process *p; |
98 | int arglen; | 98 | int arglen; |
@@ -101,93 +101,96 @@ run_process_and_wait (int pipe_control, | |||
101 | char *argp; | 101 | char *argp; |
102 | va_list ap, apc1, apc2; | 102 | va_list ap, apc1, apc2; |
103 | 103 | ||
104 | va_start (ap, filename); | 104 | va_start(ap, filename); |
105 | va_copy (apc1, ap); | 105 | va_copy(apc1, ap); |
106 | va_copy (apc2, ap); | 106 | va_copy(apc2, ap); |
107 | arglen = 0; | 107 | arglen = 0; |
108 | while (NULL != (arg = va_arg (apc1, char *))) | 108 | while (NULL != (arg = va_arg(apc1, char *))) |
109 | arglen += strlen (arg) + 1; | 109 | arglen += strlen(arg) + 1; |
110 | va_end (apc1); | 110 | va_end(apc1); |
111 | args = argp = GNUNET_malloc (arglen); | 111 | args = argp = GNUNET_malloc(arglen); |
112 | while (NULL != (arg = va_arg (apc2, char *))) | 112 | while (NULL != (arg = va_arg(apc2, char *))) |
113 | { | 113 | { |
114 | strcpy (argp, arg); | 114 | strcpy(argp, arg); |
115 | argp += strlen (arg); | 115 | argp += strlen(arg); |
116 | *argp = ' '; | 116 | *argp = ' '; |
117 | argp += 1; | 117 | argp += 1; |
118 | } | 118 | } |
119 | va_end (apc2); | 119 | va_end(apc2); |
120 | if (arglen > 0) | 120 | if (arglen > 0) |
121 | argp[-1] = '\0'; | 121 | argp[-1] = '\0'; |
122 | p = GNUNET_OS_start_process_va (pipe_control, std_inheritance, | 122 | p = GNUNET_OS_start_process_va(pipe_control, std_inheritance, |
123 | pipe_stdin, | 123 | pipe_stdin, |
124 | pipe_stdout, | 124 | pipe_stdout, |
125 | NULL, | 125 | NULL, |
126 | filename, ap); | 126 | filename, ap); |
127 | va_end (ap); | 127 | va_end(ap); |
128 | if (NULL == p) | 128 | if (NULL == p) |
129 | { | 129 | { |
130 | ret = 3; | 130 | ret = 3; |
131 | fprintf (stderr, "Failed to run `%s'\n", args); | 131 | fprintf(stderr, "Failed to run `%s'\n", args); |
132 | GNUNET_free (args); | 132 | GNUNET_free(args); |
133 | return 1; | 133 | return 1; |
134 | } | 134 | } |
135 | 135 | ||
136 | if (GNUNET_OK != GNUNET_OS_process_wait (p)) | 136 | if (GNUNET_OK != GNUNET_OS_process_wait(p)) |
137 | { | 137 | { |
138 | ret = 4; | 138 | ret = 4; |
139 | fprintf (stderr, "Failed to wait for `%s'\n", args); | 139 | fprintf(stderr, "Failed to wait for `%s'\n", args); |
140 | GNUNET_free (args); | 140 | GNUNET_free(args); |
141 | return 1; | 141 | return 1; |
142 | } | 142 | } |
143 | 143 | ||
144 | switch (GNUNET_OS_process_status (p, st, code)) | 144 | switch (GNUNET_OS_process_status(p, st, code)) |
145 | { | 145 | { |
146 | case GNUNET_OK: | 146 | case GNUNET_OK: |
147 | break; | 147 | break; |
148 | |||
148 | case GNUNET_NO: | 149 | case GNUNET_NO: |
149 | ret = 5; | 150 | ret = 5; |
150 | fprintf (stderr, "`%s' is still running\n", args); | 151 | fprintf(stderr, "`%s' is still running\n", args); |
151 | GNUNET_free (args); | 152 | GNUNET_free(args); |
152 | return 1; | 153 | return 1; |
154 | |||
153 | default: | 155 | default: |
154 | case GNUNET_SYSERR: | 156 | case GNUNET_SYSERR: |
155 | ret = 6; | 157 | ret = 6; |
156 | fprintf (stderr, "Failed to check the status of `%s'\n", args); | 158 | fprintf(stderr, "Failed to check the status of `%s'\n", args); |
157 | GNUNET_free (args); | 159 | GNUNET_free(args); |
158 | return 1; | 160 | return 1; |
159 | } | 161 | } |
160 | #ifdef WINDOWS | 162 | #ifdef WINDOWS |
161 | if (GNUNET_OS_PROCESS_EXITED != *st || 0 != *code) | 163 | if (GNUNET_OS_PROCESS_EXITED != *st || 0 != *code) |
162 | { | 164 | { |
163 | ret = 7; | 165 | ret = 7; |
164 | fprintf (stderr, "`%s' did not end correctly (%d, %d)\n", args, *st, *code); | 166 | fprintf(stderr, "`%s' did not end correctly (%d, %d)\n", args, *st, *code); |
165 | return 1; | 167 | return 1; |
166 | } | 168 | } |
167 | #endif | 169 | #endif |
168 | return 0; | 170 | return 0; |
169 | } | 171 | } |
170 | 172 | ||
171 | static void | 173 | static void |
172 | check_pkey (unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd, | 174 | check_pkey(unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd, |
173 | char *pk, int *found_rec) | 175 | char *pk, int *found_rec) |
174 | { | 176 | { |
175 | int i; | 177 | int i; |
178 | |||
176 | for (i = 0; i < rd_len; i++) | 179 | for (i = 0; i < rd_len; i++) |
177 | { | 180 | { |
178 | char *s; | 181 | char *s; |
179 | if (GNUNET_GNSRECORD_TYPE_PKEY != rd[i].record_type || | 182 | if (GNUNET_GNSRECORD_TYPE_PKEY != rd[i].record_type || |
180 | rd[i].data_size != sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)) | 183 | rd[i].data_size != sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey)) |
181 | continue; | 184 | continue; |
182 | s = GNUNET_GNSRECORD_value_to_string (rd[i].record_type, | 185 | s = GNUNET_GNSRECORD_value_to_string(rd[i].record_type, |
183 | rd[i].data, | 186 | rd[i].data, |
184 | rd[i].data_size); | 187 | rd[i].data_size); |
185 | if (NULL == s) | 188 | if (NULL == s) |
186 | continue; | 189 | continue; |
187 | if (0 == strcmp (s, pk)) | 190 | if (0 == strcmp(s, pk)) |
188 | *found_rec = GNUNET_YES; | 191 | *found_rec = GNUNET_YES; |
189 | GNUNET_free (s); | 192 | GNUNET_free(s); |
190 | } | 193 | } |
191 | } | 194 | } |
192 | 195 | ||
193 | /** | 196 | /** |
@@ -200,53 +203,54 @@ check_pkey (unsigned int rd_len, const struct GNUNET_GNSRECORD_Data *rd, | |||
200 | * @param rd array of records with data to store | 203 | * @param rd array of records with data to store |
201 | */ | 204 | */ |
202 | static void | 205 | static void |
203 | zone_iterator (void *cls, | 206 | zone_iterator(void *cls, |
204 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, | 207 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, |
205 | const char *rname, unsigned int rd_len, | 208 | const char *rname, unsigned int rd_len, |
206 | const struct GNUNET_GNSRECORD_Data *rd) | 209 | const struct GNUNET_GNSRECORD_Data *rd) |
207 | { | 210 | { |
208 | if (NULL != rname) | 211 | if (NULL != rname) |
209 | { | 212 | { |
210 | if (0 == strcmp (rname, "private")) | 213 | if (0 == strcmp(rname, "private")) |
211 | check_pkey (rd_len, rd, private_zone_pkey, &found_private_rec); | 214 | check_pkey(rd_len, rd, private_zone_pkey, &found_private_rec); |
212 | else if (0 == strcmp (rname, "pin")) | 215 | else if (0 == strcmp(rname, "pin")) |
213 | check_pkey (rd_len, rd, pin_zone_pkey, &found_pin_rec); | 216 | check_pkey(rd_len, rd, pin_zone_pkey, &found_pin_rec); |
214 | } | 217 | } |
215 | GNUNET_NAMESTORE_zone_iterator_next (list_it); | 218 | GNUNET_NAMESTORE_zone_iterator_next(list_it); |
216 | } | 219 | } |
217 | 220 | ||
218 | static void | 221 | static void |
219 | zone_iteration_error (void *cls) | 222 | zone_iteration_error(void *cls) |
220 | { | 223 | { |
221 | enum GNUNET_OS_ProcessStatusType st; | 224 | enum GNUNET_OS_ProcessStatusType st; |
222 | unsigned long code; | 225 | unsigned long code; |
226 | |||
223 | if (!found_private_rec) | 227 | if (!found_private_rec) |
224 | { | ||
225 | if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, | ||
226 | "gnunet-namestore", | ||
227 | "gnunet-namestore", "-z", "master-zone", "-a", "-e", "never", "-n", "private", "-p", "-t", "PKEY", "-V", private_zone_pkey, NULL)) | ||
228 | { | 228 | { |
229 | ret = 8; | 229 | if (0 != run_process_and_wait(GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, |
230 | return; | 230 | "gnunet-namestore", |
231 | "gnunet-namestore", "-z", "master-zone", "-a", "-e", "never", "-n", "private", "-p", "-t", "PKEY", "-V", private_zone_pkey, NULL)) | ||
232 | { | ||
233 | ret = 8; | ||
234 | return; | ||
235 | } | ||
231 | } | 236 | } |
232 | } | ||
233 | if (!found_pin_rec) | 237 | if (!found_pin_rec) |
234 | { | ||
235 | if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, | ||
236 | "gnunet-namestore", | ||
237 | "gnunet-namestore", "-z", "master-zone", "-a", "-e", "never", "-n", "pin", "-p", "-t", "PKEY", "-V", pin_zone_pkey, NULL)) | ||
238 | { | 238 | { |
239 | ret = 10; | 239 | if (0 != run_process_and_wait(GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, |
240 | return; | 240 | "gnunet-namestore", |
241 | "gnunet-namestore", "-z", "master-zone", "-a", "-e", "never", "-n", "pin", "-p", "-t", "PKEY", "-V", pin_zone_pkey, NULL)) | ||
242 | { | ||
243 | ret = 10; | ||
244 | return; | ||
245 | } | ||
241 | } | 246 | } |
242 | } | ||
243 | list_it = NULL; | 247 | list_it = NULL; |
244 | GNUNET_SCHEDULER_shutdown (); | 248 | GNUNET_SCHEDULER_shutdown(); |
245 | } | 249 | } |
246 | 250 | ||
247 | 251 | ||
248 | static void | 252 | static void |
249 | zone_iteration_finished (void *cls) | 253 | zone_iteration_finished(void *cls) |
250 | { | 254 | { |
251 | } | 255 | } |
252 | 256 | ||
@@ -283,43 +287,44 @@ zone_iteration_finished (void *cls) | |||
283 | * @param identifier identifier assigned by the user for this ego, | 287 | * @param identifier identifier assigned by the user for this ego, |
284 | * NULL if the user just deleted the ego and it | 288 | * NULL if the user just deleted the ego and it |
285 | * must thus no longer be used | 289 | * must thus no longer be used |
286 | */ | 290 | */ |
287 | static void | 291 | static void |
288 | get_ego (void *cls, | 292 | get_ego(void *cls, |
289 | struct GNUNET_IDENTITY_Ego *ego, | 293 | struct GNUNET_IDENTITY_Ego *ego, |
290 | void **ctx, | 294 | void **ctx, |
291 | const char *identifier) | 295 | const char *identifier) |
292 | { | 296 | { |
293 | static struct GNUNET_CRYPTO_EcdsaPublicKey pk; | 297 | static struct GNUNET_CRYPTO_EcdsaPublicKey pk; |
298 | |||
294 | if (NULL == ego) | 299 | if (NULL == ego) |
295 | { | ||
296 | if (NULL == master_zone_pkey || | ||
297 | NULL == private_zone_pkey) | ||
298 | { | 300 | { |
299 | ret = 11; | 301 | if (NULL == master_zone_pkey || |
300 | GNUNET_SCHEDULER_shutdown (); | 302 | NULL == private_zone_pkey) |
303 | { | ||
304 | ret = 11; | ||
305 | GNUNET_SCHEDULER_shutdown(); | ||
306 | return; | ||
307 | } | ||
308 | list_it = GNUNET_NAMESTORE_zone_iteration_start(ns, | ||
309 | &master_pk, &zone_iteration_error, NULL, &zone_iterator, NULL, &zone_iteration_finished, NULL); | ||
310 | if (NULL == list_it) | ||
311 | { | ||
312 | ret = 12; | ||
313 | GNUNET_SCHEDULER_shutdown(); | ||
314 | } | ||
301 | return; | 315 | return; |
302 | } | 316 | } |
303 | list_it = GNUNET_NAMESTORE_zone_iteration_start (ns, | 317 | GNUNET_IDENTITY_ego_get_public_key(ego, &pk); |
304 | &master_pk, &zone_iteration_error, NULL, &zone_iterator, NULL, &zone_iteration_finished, NULL); | ||
305 | if (NULL == list_it) | ||
306 | { | ||
307 | ret = 12; | ||
308 | GNUNET_SCHEDULER_shutdown (); | ||
309 | } | ||
310 | return; | ||
311 | } | ||
312 | GNUNET_IDENTITY_ego_get_public_key (ego, &pk); | ||
313 | if (NULL != identifier) | 318 | if (NULL != identifier) |
314 | { | ||
315 | if (NULL == master_zone_pkey && 0 == strcmp ("master-zone", identifier)) | ||
316 | { | 319 | { |
317 | master_zone_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk); | 320 | if (NULL == master_zone_pkey && 0 == strcmp("master-zone", identifier)) |
318 | master_pk = *GNUNET_IDENTITY_ego_get_private_key (ego); | 321 | { |
322 | master_zone_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string(&pk); | ||
323 | master_pk = *GNUNET_IDENTITY_ego_get_private_key(ego); | ||
324 | } | ||
325 | else if (NULL == private_zone_pkey && 0 == strcmp("private-zone", identifier)) | ||
326 | private_zone_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string(&pk); | ||
319 | } | 327 | } |
320 | else if (NULL == private_zone_pkey && 0 == strcmp ("private-zone", identifier)) | ||
321 | private_zone_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk); | ||
322 | } | ||
323 | } | 328 | } |
324 | 329 | ||
325 | /** | 330 | /** |
@@ -328,27 +333,27 @@ get_ego (void *cls, | |||
328 | * @param cls NULL | 333 | * @param cls NULL |
329 | */ | 334 | */ |
330 | static void | 335 | static void |
331 | shutdown_task (void *cls) | 336 | shutdown_task(void *cls) |
332 | { | 337 | { |
333 | GNUNET_free_non_null (master_zone_pkey); | 338 | GNUNET_free_non_null(master_zone_pkey); |
334 | master_zone_pkey = NULL; | 339 | master_zone_pkey = NULL; |
335 | GNUNET_free_non_null (private_zone_pkey); | 340 | GNUNET_free_non_null(private_zone_pkey); |
336 | private_zone_pkey = NULL; | 341 | private_zone_pkey = NULL; |
337 | if (NULL != list_it) | 342 | if (NULL != list_it) |
338 | { | 343 | { |
339 | GNUNET_NAMESTORE_zone_iteration_stop (list_it); | 344 | GNUNET_NAMESTORE_zone_iteration_stop(list_it); |
340 | list_it = NULL; | 345 | list_it = NULL; |
341 | } | 346 | } |
342 | if (NULL != ns) | 347 | if (NULL != ns) |
343 | { | 348 | { |
344 | GNUNET_NAMESTORE_disconnect (ns); | 349 | GNUNET_NAMESTORE_disconnect(ns); |
345 | ns = NULL; | 350 | ns = NULL; |
346 | } | 351 | } |
347 | if (NULL != sh) | 352 | if (NULL != sh) |
348 | { | 353 | { |
349 | GNUNET_IDENTITY_disconnect (sh); | 354 | GNUNET_IDENTITY_disconnect(sh); |
350 | sh = NULL; | 355 | sh = NULL; |
351 | } | 356 | } |
352 | } | 357 | } |
353 | 358 | ||
354 | /** | 359 | /** |
@@ -360,71 +365,71 @@ shutdown_task (void *cls) | |||
360 | * @param c configuration | 365 | * @param c configuration |
361 | */ | 366 | */ |
362 | static void | 367 | static void |
363 | run (void *cls, char *const *args, const char *cfgfile, | 368 | run(void *cls, char *const *args, const char *cfgfile, |
364 | const struct GNUNET_CONFIGURATION_Handle *c) | 369 | const struct GNUNET_CONFIGURATION_Handle *c) |
365 | { | 370 | { |
366 | enum GNUNET_OS_ProcessStatusType st; | 371 | enum GNUNET_OS_ProcessStatusType st; |
367 | unsigned long code; | 372 | unsigned long code; |
368 | 373 | ||
369 | cfg = c; | 374 | cfg = c; |
370 | 375 | ||
371 | if (0 != run_process_and_wait (GNUNET_NO, 0, NULL, NULL, &st, &code, | 376 | if (0 != run_process_and_wait(GNUNET_NO, 0, NULL, NULL, &st, &code, |
372 | "gnunet-arm", | 377 | "gnunet-arm", |
373 | "gnunet-arm", "-I", NULL)) | 378 | "gnunet-arm", "-I", NULL)) |
374 | { | 379 | { |
375 | if (7 == ret) | 380 | if (7 == ret) |
376 | fprintf (stderr, "GNUnet is not running, please start GNUnet before running import\n"); | 381 | fprintf(stderr, "GNUnet is not running, please start GNUnet before running import\n"); |
377 | return; | 382 | return; |
378 | } | 383 | } |
379 | 384 | ||
380 | if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, | 385 | if (0 != run_process_and_wait(GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, |
381 | "gnunet-identity", | 386 | "gnunet-identity", |
382 | "gnunet-identity", "-C", "master-zone", NULL)) | 387 | "gnunet-identity", "-C", "master-zone", NULL)) |
383 | return; | 388 | return; |
384 | 389 | ||
385 | if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, | 390 | if (0 != run_process_and_wait(GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, |
386 | "gnunet-identity", | 391 | "gnunet-identity", |
387 | "gnunet-identity", "-C", "private-zone", NULL)) | 392 | "gnunet-identity", "-C", "private-zone", NULL)) |
388 | return; | 393 | return; |
389 | 394 | ||
390 | if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, | 395 | if (0 != run_process_and_wait(GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, |
391 | "gnunet-identity", | 396 | "gnunet-identity", |
392 | "gnunet-identity", "-C", "sks-zone", NULL)) | 397 | "gnunet-identity", "-C", "sks-zone", NULL)) |
393 | return; | 398 | return; |
394 | 399 | ||
395 | if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, | 400 | if (0 != run_process_and_wait(GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, |
396 | "gnunet-identity", | 401 | "gnunet-identity", |
397 | "gnunet-identity", "-e", "master-zone", "-s", "gns-master", NULL)) | 402 | "gnunet-identity", "-e", "master-zone", "-s", "gns-master", NULL)) |
398 | return; | 403 | return; |
399 | 404 | ||
400 | if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, | 405 | if (0 != run_process_and_wait(GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, |
401 | "gnunet-identity", | 406 | "gnunet-identity", |
402 | "gnunet-identity", "-e", "master-zone", "-s", "namestore", NULL)) | 407 | "gnunet-identity", "-e", "master-zone", "-s", "namestore", NULL)) |
403 | return; | 408 | return; |
404 | 409 | ||
405 | if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, | 410 | if (0 != run_process_and_wait(GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, |
406 | "gnunet-identity", | 411 | "gnunet-identity", |
407 | "gnunet-identity", "-e", "master-zone", "-s", "gns-proxy", NULL)) | 412 | "gnunet-identity", "-e", "master-zone", "-s", "gns-proxy", NULL)) |
408 | return; | 413 | return; |
409 | 414 | ||
410 | if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, | 415 | if (0 != run_process_and_wait(GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, |
411 | "gnunet-identity", | 416 | "gnunet-identity", |
412 | "gnunet-identity", "-e", "master-zone", "-s", "gns-intercept", NULL)) | 417 | "gnunet-identity", "-e", "master-zone", "-s", "gns-intercept", NULL)) |
413 | return; | 418 | return; |
414 | 419 | ||
415 | if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, | 420 | if (0 != run_process_and_wait(GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, |
416 | "gnunet-identity", | 421 | "gnunet-identity", |
417 | "gnunet-identity", "-e", "private-zone", "-s", "gns-private", NULL)) | 422 | "gnunet-identity", "-e", "private-zone", "-s", "gns-private", NULL)) |
418 | return; | 423 | return; |
419 | 424 | ||
420 | if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, | 425 | if (0 != run_process_and_wait(GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, |
421 | "gnunet-identity", | 426 | "gnunet-identity", |
422 | "gnunet-identity", "-e", "sks-zone", "-s", "fs-sks", NULL)) | 427 | "gnunet-identity", "-e", "sks-zone", "-s", "fs-sks", NULL)) |
423 | return; | 428 | return; |
424 | 429 | ||
425 | ns = GNUNET_NAMESTORE_connect (cfg); | 430 | ns = GNUNET_NAMESTORE_connect(cfg); |
426 | sh = GNUNET_IDENTITY_connect (cfg, &get_ego, NULL); | 431 | sh = GNUNET_IDENTITY_connect(cfg, &get_ego, NULL); |
427 | GNUNET_SCHEDULER_add_shutdown (&shutdown_task, NULL); | 432 | GNUNET_SCHEDULER_add_shutdown(&shutdown_task, NULL); |
428 | } | 433 | } |
429 | 434 | ||
430 | 435 | ||
@@ -436,23 +441,23 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
436 | * @return 0 ok, 1 on error | 441 | * @return 0 ok, 1 on error |
437 | */ | 442 | */ |
438 | int | 443 | int |
439 | main (int argc, char *const *argv) | 444 | main(int argc, char *const *argv) |
440 | { | 445 | { |
441 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 446 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { |
442 | GNUNET_GETOPT_OPTION_END | 447 | GNUNET_GETOPT_OPTION_END |
443 | }; | 448 | }; |
444 | int r; | 449 | int r; |
445 | 450 | ||
446 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) | 451 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args(argc, argv, &argc, &argv)) |
447 | return 2; | 452 | return 2; |
448 | 453 | ||
449 | GNUNET_log_setup ("gnunet-gns-import", "WARNING", NULL); | 454 | GNUNET_log_setup("gnunet-gns-import", "WARNING", NULL); |
450 | ret = 0; | 455 | ret = 0; |
451 | r = GNUNET_PROGRAM_run (argc, argv, "gnunet-gns-import", | 456 | r = GNUNET_PROGRAM_run(argc, argv, "gnunet-gns-import", |
452 | _("This program will import some GNS authorities into your GNS namestore."), | 457 | _("This program will import some GNS authorities into your GNS namestore."), |
453 | options, | 458 | options, |
454 | &run, NULL); | 459 | &run, NULL); |
455 | GNUNET_free ((void*) argv); | 460 | GNUNET_free((void*)argv); |
456 | return GNUNET_OK == r ? ret : 1; | 461 | return GNUNET_OK == r ? ret : 1; |
457 | } | 462 | } |
458 | 463 | ||