X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;ds=sidebyside;f=src%2Futil.cpp;h=dc03e9dfb133c60e15a830711214fb5015c1fb15;hb=e8f8107bdd0d1149117f06e10b145ef00d5543fb;hp=ed7b42e61ff87a407c981ff791cd92d05459136a;hpb=ee6b02b81d1fd34e2735518d3683f4db3118f247;p=cassiopeia.git diff --git a/src/util.cpp b/src/util.cpp index ed7b42e..dc03e9d 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -30,6 +30,7 @@ std::string writeBackFile( const std::string& serial, const std::string& cert, c errno = 0; std::string filename = keydir; + if( 0 != mkdir( filename.c_str(), 0755 ) ) { if( EEXIST != errno ) { return ""; @@ -39,6 +40,7 @@ std::string writeBackFile( const std::string& serial, const std::string& cert, c } filename += "/crt"; + if( 0 != mkdir( filename.c_str(), 0755 ) ) { if( EEXIST != errno ) { return ""; @@ -46,6 +48,7 @@ std::string writeBackFile( const std::string& serial, const std::string& cert, c //! \FIXME: Check this is a directory } + std::string first; if( serial.length() < 3 ) { @@ -55,6 +58,7 @@ std::string writeBackFile( const std::string& serial, const std::string& cert, c } filename += "/" + first; + if( 0 != mkdir( filename.c_str(), 0755 ) ) { if( EEXIST != errno ) { return "";