From 5d522ddec836b6d208780dac45f4a37bee12acab Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 18 Nov 2014 12:49:29 +1100 Subject: [PATCH] ckdb - fail auth if users.status isn't empty --- src/ckdb.h | 2 +- src/ckdb_dbio.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ckdb.h b/src/ckdb.h index 61848f18..bb35f06d 100644 --- a/src/ckdb.h +++ b/src/ckdb.h @@ -52,7 +52,7 @@ #define DB_VLOCK "1" #define DB_VERSION "0.9.4" -#define CKDB_VERSION DB_VERSION"-0.641" +#define CKDB_VERSION DB_VERSION"-0.642" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__ diff --git a/src/ckdb_dbio.c b/src/ckdb_dbio.c index 8c0b3d52..f837e78b 100644 --- a/src/ckdb_dbio.c +++ b/src/ckdb_dbio.c @@ -4055,6 +4055,10 @@ bool auths_add(PGconn *conn, char *poolinstance, char *username, } DATA_USERS(*users, u_item); + // Any status content means disallow mining + if ((*users)->status[0]) + goto unitem; + STRNCPY(row->poolinstance, poolinstance); row->userid = (*users)->userid; // since update=false, a dup will be ok and do nothing when igndup=true