/*
tincctl.c -- Controlling a running tincd
- Copyright (C) 2007-2017 Guus Sliepen <guus@tinc-vpn.org>
+ Copyright (C) 2007-2018 Guus Sliepen <guus@tinc-vpn.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static void version(void) {
printf("%s version %s (built %s %s, protocol %d.%d)\n", PACKAGE,
BUILD_VERSION, BUILD_DATE, BUILD_TIME, PROT_MAJOR, PROT_MINOR);
- printf("Copyright (C) 1998-2017 Ivo Timmermans, Guus Sliepen and others.\n"
+ printf("Copyright (C) 1998-2018 Ivo Timmermans, Guus Sliepen and others.\n"
"See the AUTHORS file for a complete list.\n\n"
"tinc comes with ABSOLUTELY NO WARRANTY. This is free software,\n"
"and you are welcome to redistribute it under certain conditions;\n"
SC_HANDLE manager = NULL;
SC_HANDLE service = NULL;
SERVICE_STATUS status = {0};
+ bool success = false;
manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
if(!manager) {
fprintf(stderr, "Could not open service manager: %s\n", winerror(GetLastError()));
- return false;
+ goto exit;
}
service = OpenService(manager, identname, SERVICE_ALL_ACCESS);
if(!service) {
fprintf(stderr, "Could not open %s service: %s\n", identname, winerror(GetLastError()));
- return false;
+ goto exit;
}
if(!ControlService(service, SERVICE_CONTROL_STOP, &status)) {
if(!DeleteService(service)) {
fprintf(stderr, "Could not remove %s service: %s\n", identname, winerror(GetLastError()));
- return false;
+ goto exit;
}
+ success = true;
+
+exit:
+
if(service) {
CloseServiceHandle(service);
}
CloseServiceHandle(manager);
}
- fprintf(stderr, "%s service removed\n", identname);
+ if(success) {
+ fprintf(stderr, "%s service removed\n", identname);
+ }
- return true;
+ return success;
}
#endif
{"Ed25519PrivateKeyFile", VAR_SERVER},
{"ExperimentalProtocol", VAR_SERVER},
{"Forwarding", VAR_SERVER},
+ {"FWMark", VAR_SERVER},
{"GraphDumpFile", VAR_SERVER | VAR_OBSOLETE},
{"Hostnames", VAR_SERVER},
{"IffOneQueue", VAR_SERVER},