diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2018-11-19 19:11:06 +0200 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2018-11-19 19:11:06 +0200 |
commit | 78ee1c72c670a71bfd165448676fc65bff802916 (patch) | |
tree | 893b0f09dfc84f3fd7f1ac218213012f33d5b612 /src/dblayer.c | |
parent | 84bbbb91c9154ca0b1c295eb7d1aa0de59450764 (diff) | |
download | ck-78ee1c72c670a71bfd165448676fc65bff802916.tar.gz ck-78ee1c72c670a71bfd165448676fc65bff802916.tar.bz2 ck-78ee1c72c670a71bfd165448676fc65bff802916.zip |
Add ability to use ck without secret dir
Diffstat (limited to 'src/dblayer.c')
-rw-r--r-- | src/dblayer.c | 21 |
1 files changed, 21 insertions, 0 deletions
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; +} |