summaryrefslogtreecommitdiff
path: root/src/vpn/gnunet-helper-vpn-windows.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vpn/gnunet-helper-vpn-windows.c')
-rw-r--r--src/vpn/gnunet-helper-vpn-windows.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/vpn/gnunet-helper-vpn-windows.c b/src/vpn/gnunet-helper-vpn-windows.c
index 5166a055c..7dee53609 100644
--- a/src/vpn/gnunet-helper-vpn-windows.c
+++ b/src/vpn/gnunet-helper-vpn-windows.c
@@ -63,9 +63,9 @@
63#endif 63#endif
64 64
65/** 65/**
66 * Will this binary be run in dryrun-mode? 66 * Will this binary be run in permissions testing mode?
67 */ 67 */
68static BOOL dryrun = FALSE; 68static boolean privilege_testing = FALSE;
69 69
70/** 70/**
71 * Maximum size of a GNUnet message (GNUNET_SERVER_MAX_MESSAGE_SIZE) 71 * Maximum size of a GNUnet message (GNUNET_SERVER_MAX_MESSAGE_SIZE)
@@ -1356,8 +1356,8 @@ run (HANDLE tap_handle)
1356 * DHCP and such are all features we will never use in gnunet afaik. 1356 * DHCP and such are all features we will never use in gnunet afaik.
1357 * But for openvpn those are essential. 1357 * But for openvpn those are essential.
1358 */ 1358 */
1359 if (! tun_up (tap_handle)) 1359 if ((privilege_testing) || (! tun_up (tap_handle))
1360 return; 1360 goto teardown_final;
1361 1361
1362 /* Initialize our overlapped IO structures*/ 1362 /* Initialize our overlapped IO structures*/
1363 if (! (initialize_io_facility (&tap_read, IOSTATE_READY, FALSE) 1363 if (! (initialize_io_facility (&tap_read, IOSTATE_READY, FALSE)
@@ -1412,9 +1412,6 @@ run (HANDLE tap_handle)
1412 } 1412 }
1413#endif 1413#endif
1414 1414
1415 if (dryrun)
1416 goto teardown;
1417
1418 fprintf (stderr, "DEBUG: mainloop has begun\n"); 1415 fprintf (stderr, "DEBUG: mainloop has begun\n");
1419 1416
1420 while (std_out.path_open || tap_write.path_open) 1417 while (std_out.path_open || tap_write.path_open)
@@ -1441,9 +1438,7 @@ teardown:
1441 CancelIo (tap_handle); 1438 CancelIo (tap_handle);
1442 CancelIo (std_in.handle); 1439 CancelIo (std_in.handle);
1443 CancelIo (std_out.handle); 1440 CancelIo (std_out.handle);
1444
1445teardown_final: 1441teardown_final:
1446
1447 CloseHandle (tap_handle); 1442 CloseHandle (tap_handle);
1448} 1443}
1449 1444
@@ -1470,8 +1465,8 @@ main (int argc, char **argv)
1470 BOOL have_ip6 = FALSE; 1465 BOOL have_ip6 = FALSE;
1471 1466
1472 if (argc > 1 && 0 != strcmp (argv[1], "-d")){ 1467 if (argc > 1 && 0 != strcmp (argv[1], "-d")){
1473 dryrun = TRUE; 1468 privilege_testing = TRUE;
1474 fprintf (stderr, "DEBUG: Running binary in dryrun mode.", argv[0]); 1469 fprintf (stderr, "DEBUG: Running binary in privilege testing mode.", argv[0]);
1475 argv++; 1470 argv++;
1476 argc--; 1471 argc--;
1477 } 1472 }