X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Ftincd.c;h=3dab9a01157b5751c14a65f24fc3d82ae94ea94f;hp=dc9bf4696eddbb4fe0f1e2f3ca7e5c55955b5899;hb=aca70cd3c3fe787e62c618849e43f67b3870ac20;hpb=8c3105283ac53f8cc9cc4dde25957ec1cf6b53a0 diff --git a/src/tincd.c b/src/tincd.c index dc9bf469..3dab9a01 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -4,6 +4,8 @@ 2000-2010 Guus Sliepen 2008 Max Rijevski 2009 Michael Tokarev + 2010 Julien Muchembled + 2010 Timothy Redaelli 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 @@ -219,7 +221,9 @@ static bool parse_options(int argc, char **argv) { 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 */ @@ -363,6 +367,7 @@ static bool keygen(int bits) { fchmod(fileno(f), 0600); #endif + fputc('\n', f); PEM_write_RSAPrivateKey(f, rsa_key, NULL, NULL, 0, NULL, NULL); fclose(f); free(filename); @@ -380,6 +385,7 @@ static bool keygen(int bits) { 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);