]> WPIA git - cassiopeia.git/commitdiff
fix: psql, store serials in lowercase
authorFelix Dörre <felix@dogcraft.de>
Sun, 8 Nov 2015 10:31:57 +0000 (11:31 +0100)
committerFelix Dörre <felix@dogcraft.de>
Sun, 8 Nov 2015 10:31:57 +0000 (11:31 +0100)
src/db/psql.cpp

index 619c3a7d0f468e807ed1d8714561971b82e6186c..a001b767973baa611fc2d181fecec1246bff1123 100644 (file)
@@ -128,8 +128,9 @@ void PostgresJobProvider::writeBack( std::shared_ptr<Job> job, std::shared_ptr<S
     } else {
         read_id = r[0]["id"].as<std::string>();
     }
-
-    std::string q = "UPDATE certs SET crt_name=" + txn.quote( res->crt_name ) + ", serial=" + txn.quote( res->serial ) + ", \"caid\" = " + txn.quote( read_id ) + ", created=" + txn.quote( pgTime(res->before) ) + ", expire=" + txn.quote( pgTime(res->after) ) + "  WHERE id=" + txn.quote( job->target );
+    std::string serial = res->serial;
+    std::transform(serial.begin(), serial.end(), serial.begin(), ::tolower);
+    std::string q = "UPDATE certs SET crt_name=" + txn.quote( res->crt_name ) + ", serial=" + txn.quote( serial ) + ", \"caid\" = " + txn.quote( read_id ) + ", created=" + txn.quote( pgTime(res->before) ) + ", expire=" + txn.quote( pgTime(res->after) ) + "  WHERE id=" + txn.quote( job->target );
     // TODO write more thingies back
 
     r = txn.exec( q );