From e5ebd9a7ae7a5178de85499b0aa7dc3a1cc9f124 Mon Sep 17 00:00:00 2001 From: kanoi Date: Fri, 8 Aug 2014 22:13:10 +1000 Subject: [PATCH] ckdb - optional pgsql password --- src/ckdb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ckdb.c b/src/ckdb.c index 242727ba..8ff1f858 100644 --- a/src/ckdb.c +++ b/src/ckdb.c @@ -1725,7 +1725,10 @@ static PGconn *dbconnect() char conninfo[128]; PGconn *conn; - snprintf(conninfo, sizeof(conninfo), "host=127.0.0.1 dbname=ckdb user=%s", db_user); + snprintf(conninfo, sizeof(conninfo), + "host=127.0.0.1 dbname=ckdb user=%s%s%s", + db_user, db_pass ? " password=" : "", + db_pass ? db_pass : ""); conn = PQconnectdb(conninfo); if (PQstatus(conn) != CONNECTION_OK) @@ -7860,8 +7863,6 @@ int main(int argc, char **argv) check_restore_dir(); -// if (!db_pass) -// zzz if (!db_user) db_user = "postgres"; if (!ckp.name)