2000-2010 Guus Sliepen <guus@tinc-vpn.org>
2008 Max Rijevski <maksuf@gmail.com>
2009 Michael Tokarev <mjt@tls.msk.ru>
+ 2010 Julien Muchembled <jm@jmuchemb.eu>
+ 2010 Timothy Redaelli <timothy@redaelli.eu>
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
kill_tincd = SIGINT;
else if(!strcasecmp(optarg, "ALRM"))
kill_tincd = SIGALRM;
+ else if(!strcasecmp(optarg, "ABRT"))
+ kill_tincd = SIGABRT;
else {
kill_tincd = atoi(optarg);
break;
case 'n': /* net name given */
- netname = xstrdup(optarg);
+ /* netname "." is special: a "top-level name" */
+ netname = strcmp(optarg, ".") != 0 ?
+ xstrdup(optarg) : NULL;
break;
case 'o': /* option */
fchmod(fileno(f), 0600);
#endif
+ fputc('\n', f);
PEM_write_RSAPrivateKey(f, rsa_key, NULL, NULL, 0, NULL, NULL);
fclose(f);
free(filename);
if(disable_old_keys(f))
fprintf(stderr, "Warning: old key(s) found and disabled.\n");
+ fputc('\n', f);
PEM_write_RSAPublicKey(f, rsa_key);
fclose(f);
free(filename);
}
#ifdef HAVE_MINGW
-# define setpriority(level) SetPriorityClass(GetCurrentProcess(), level)
+# define setpriority(level) SetPriorityClass(GetCurrentProcess(), (level))
#else
# define NORMAL_PRIORITY_CLASS 0
# define BELOW_NORMAL_PRIORITY_CLASS 10
# define HIGH_PRIORITY_CLASS -10
-# define setpriority(level) nice(level)
+# define setpriority(level) (setpriority(PRIO_PROCESS, 0, (level)))
#endif
int main(int argc, char **argv) {