X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnet_setup.c;h=5a7c6065ef830d68b5ca2694f50a9e4559e79108;hp=ddb0bcfd7f2fdc32c53ddc598c7577a8cee08bfc;hb=fb5fcc575d25a51acf73d476f63ce72f30cda6c2;hpb=c6b1643c2bcc727db4aed69bc58eb1f31903fdcf;ds=sidebyside diff --git a/src/net_setup.c b/src/net_setup.c index ddb0bcfd..5a7c6065 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -1,7 +1,7 @@ /* net_setup.c -- Setup. Copyright (C) 1998-2005 Ivo Timmermans, - 2000-2012 Guus Sliepen + 2000-2013 Guus Sliepen 2006 Scott Lamb 2010 Brandon Black @@ -163,7 +163,6 @@ bool read_rsa_public_key(connection_t *c) { static bool read_rsa_private_key(void) { FILE *fp; char *fname, *key, *pubkey; - struct stat s; if(get_config_string(lookup_config(config_tree, "PrivateKey"), &key)) { if(!get_config_string(lookup_config(config_tree, "PublicKey"), &pubkey)) { @@ -199,6 +198,8 @@ static bool read_rsa_private_key(void) { } #if !defined(HAVE_MINGW) && !defined(HAVE_CYGWIN) + struct stat s; + if(fstat(fileno(fp), &s)) { logger(LOG_ERR, "Could not stat RSA private key file `%s': %s'", fname, strerror(errno));