mirror of
https://github.com/AGWA/git-crypt.git
synced 2025-12-22 23:26:11 -08:00
Lay groundwork for Windows support
Move Unix-specific code to util-unix.cpp, and place Windows equivalents in util-win32.cpp. Most of the Windows functions are just stubs at the moment, and we need a build system that works on Windows.
This commit is contained in:
3
key.cpp
3
key.cpp
@@ -33,6 +33,7 @@
|
||||
#include "crypto.hpp"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdint.h>
|
||||
#include <fstream>
|
||||
#include <istream>
|
||||
#include <ostream>
|
||||
@@ -133,7 +134,7 @@ bool Key_file::load_from_file (const char* key_file_name)
|
||||
|
||||
bool Key_file::store_to_file (const char* key_file_name) const
|
||||
{
|
||||
mode_t old_umask = umask(0077); // make sure key file is protected
|
||||
mode_t old_umask = umask(0077); // make sure key file is protected (TODO: Windows compat)
|
||||
std::ofstream key_file_out(key_file_name, std::fstream::binary);
|
||||
umask(old_umask);
|
||||
if (!key_file_out) {
|
||||
|
||||
Reference in New Issue
Block a user