From 78ee1c72c670a71bfd165448676fc65bff802916 Mon Sep 17 00:00:00 2001 From: gramanas Date: Mon, 19 Nov 2018 19:11:06 +0200 Subject: Add ability to use ck without secret dir --- src/dblayer.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/dblayer.c') diff --git a/src/dblayer.c b/src/dblayer.c index f13236c..3a8dd4f 100644 --- a/src/dblayer.c +++ b/src/dblayer.c @@ -315,3 +315,24 @@ int get_program_paths(DB *db, cklist *ckl, const char* pName, int bname, int att } return -1; } + +int secret_enabled(DB *db) { + sqlite3_stmt *stmt; + int rc; + + char sql[STR_M] = ""; + dbh_form_query_secret_enabled(sql); + + rc = sqlite3_prepare_v2(db->ptr, sql, -1, &stmt, 0); + if (rc != SQLITE_OK) { + ERR("while preparing secret_enabled sql."); + return -2; + } + int enabled = 1; + while (sqlite3_step(stmt) == SQLITE_ROW) { + enabled = sqlite3_column_int(stmt, 0); + break; + } + sqlite3_finalize(stmt); + return enabled; +} -- cgit v1.2.3