projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into 1.1
[tinc]
/
src
/
tincd.c
diff --git
a/src/tincd.c
b/src/tincd.c
index
c0c12ad
..
ac0cbc6
100644
(file)
--- a/
src/tincd.c
+++ b/
src/tincd.c
@@
-1,7
+1,7
@@
/*
tincd.c -- the main file for tincd
Copyright (C) 1998-2005 Ivo Timmermans
/*
tincd.c -- the main file for tincd
Copyright (C) 1998-2005 Ivo Timmermans
- 2000-200
7
Guus Sliepen <guus@tinc-vpn.org>
+ 2000-200
9
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
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
@@
-104,6
+104,7
@@
static void usage(bool status)
" -L, --mlock Lock tinc into main memory.\n"
" --logfile[=FILENAME] Write log entries to a logfile.\n"
" --controlsocket=FILENAME Open control socket at FILENAME.\n"
" -L, --mlock Lock tinc into main memory.\n"
" --logfile[=FILENAME] Write log entries to a logfile.\n"
" --controlsocket=FILENAME Open control socket at FILENAME.\n"
+ " --bypass-security Disables meta protocol security, for debugging.\n"
" --help Display this help and exit.\n"
" --version Output version information and exit.\n\n"));
printf(_("Report bugs to tinc@tinc-vpn.org.\n"));
" --help Display this help and exit.\n"
" --version Output version information and exit.\n\n"));
printf(_("Report bugs to tinc@tinc-vpn.org.\n"));
@@
-185,7
+186,7
@@
static void make_names(void)
#ifdef HAVE_MINGW
HKEY key;
char installdir[1024] = "";
#ifdef HAVE_MINGW
HKEY key;
char installdir[1024] = "";
- long len = sizeof
(installdir)
;
+ long len = sizeof
installdir
;
#endif
if(netname)
#endif
if(netname)
@@
-212,7
+213,7
@@
static void make_names(void)
#endif
if(!controlsocketname)
#endif
if(!controlsocketname)
- asprintf(&controlsocketname,
LOCALSTATEDIR "/run/%s.control"
, identname);
+ asprintf(&controlsocketname,
"%s/run/%s.control/socket", LOCALSTATEDIR
, identname);
if(!logfilename)
asprintf(&logfilename, LOCALSTATEDIR "/log/%s.log", identname);
if(!logfilename)
asprintf(&logfilename, LOCALSTATEDIR "/log/%s.log", identname);
@@
-228,6
+229,14
@@
static void make_names(void)
}
}
}
}
+static void free_names() {
+ if (identname) free(identname);
+ if (netname) free(netname);
+ if (controlsocketname) free(controlsocketname);
+ if (logfilename) free(logfilename);
+ if (confbase) free(confbase);
+}
+
int main(int argc, char **argv)
{
program_name = argv[0];
int main(int argc, char **argv)
{
program_name = argv[0];
@@
-244,7
+253,7
@@
int main(int argc, char **argv)
if(show_version) {
printf(_("%s version %s (built %s %s, protocol %d)\n"), PACKAGE,
VERSION, __DATE__, __TIME__, PROT_CURRENT);
if(show_version) {
printf(_("%s version %s (built %s %s, protocol %d)\n"), PACKAGE,
VERSION, __DATE__, __TIME__, PROT_CURRENT);
- printf(_("Copyright (C) 1998-200
7
Ivo Timmermans, Guus Sliepen and others.\n"
+ printf(_("Copyright (C) 1998-200
9
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"
"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"
@@
-330,11
+339,11
@@
int main2(int argc, char **argv)
/* Shutdown properly. */
/* Shutdown properly. */
- close_network_connections();
-
ifdebug(CONNECTIONS)
dump_device_stats();
ifdebug(CONNECTIONS)
dump_device_stats();
+ close_network_connections();
+
end:
logger(LOG_NOTICE, _("Terminating"));
end:
logger(LOG_NOTICE, _("Terminating"));