]> WPIA git - cassiopeia.git/blobdiff - src/apps/client.cpp
fix: Check return value of writeBackFile for non-empty filename
[cassiopeia.git] / src / apps / client.cpp
index 7c5bf0888b5a9bb3ac6996e7e02cd1ec19ca2aa7..e30803e690ba333e6c0f828df4e9675a9a7f89ed 100644 (file)
@@ -159,8 +159,14 @@ int main( int argc, const char* argv[] ) {
                 log << "FINE: CERTIFICATE LOG: " << res->log << std::endl;
                 log << "FINE: CERTIFICATE:" << std::endl << res->certificate << std::endl;
                 std::string fn = writeBackFile( job->target.c_str(), res->certificate, keyDir );
+                if( fn.empty() ) {
+                    log << "ERROR: Writeback of the certificate failed." << std::endl;
+                    jp->failJob( job );
+                    continue;
+                }
+
                 res->crt_name = fn;
-                jp->writeBack( job, res );
+                jp->writeBack( job, res ); //! \FIXME: Check return value
                 log << "FINE: signing done." << std::endl;
 
                 if( DAEMON ) {