From c8f89279026af6bb03ef3d66e44e859fb7208925 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Sun, 30 Sep 2012 17:16:58 +0200 Subject: autocreate key dir --- distfoldd/localkey.cc | 6 ++++++ distfoldd/localkey.h | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/distfoldd/localkey.cc b/distfoldd/localkey.cc index 9855ff4..f104afd 100644 --- a/distfoldd/localkey.cc +++ b/distfoldd/localkey.cc @@ -19,6 +19,12 @@ bool LocalKey::setupLocalKey() if (local_key_dir.exists("server.crt") && local_key_dir.exists("server.key")) { return true; } + if (!local_key_dir.exists()) { + if (!local_key_dir.mkpath(local_key_dir.absolutePath())) { + qWarning() << "Could not create local key directory"; + return false; + } + } QCA::Initializer qca; diff --git a/distfoldd/localkey.h b/distfoldd/localkey.h index ad23091..9d9e6a8 100644 --- a/distfoldd/localkey.h +++ b/distfoldd/localkey.h @@ -10,8 +10,6 @@ private: public: static QString localKeyDir(); - static QString localCertPath(); - static QString localPrivateKeyPath(); static bool setupLocalKey(); }; -- cgit v1.2.3