From d0b9ad84ae751ec083a1866b17c49bc9c0b6d3b9 Mon Sep 17 00:00:00 2001 From: Andrew Ayer Date: Fri, 6 Jul 2012 16:30:36 -0700 Subject: [PATCH] Create key file with umask of 077 --- commands.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commands.cpp b/commands.cpp index 24c3a41..f631332 100644 --- a/commands.cpp +++ b/commands.cpp @@ -1,6 +1,8 @@ #include "commands.hpp" #include "crypto.hpp" #include "util.hpp" +#include +#include #include #include #include @@ -180,6 +182,7 @@ void init (const char* argv0, const char* keyfile) void keygen (const char* keyfile) { + umask(0077); // make sure key file is protected std::ofstream keyout(keyfile); if (!keyout) { perror(keyfile);