MXS-2544 Add utility class for handling SQLite
Preparation and cleanup for adding more data to handle user roles in PAM authenticator.
This commit is contained in:
@ -20,23 +20,27 @@
|
||||
/** The instance class for the client side PAM authenticator, created in pam_auth_init() */
|
||||
class PamInstance
|
||||
{
|
||||
PamInstance(const PamInstance& orig);
|
||||
PamInstance& operator=(const PamInstance&);
|
||||
public:
|
||||
PamInstance(const PamInstance& orig) = delete;
|
||||
PamInstance& operator=(const PamInstance&) = delete;
|
||||
|
||||
static PamInstance* create(char** options);
|
||||
~PamInstance();
|
||||
|
||||
int load_users(SERVICE* service);
|
||||
void diagnostic(DCB* dcb);
|
||||
json_t* diagnostic_json();
|
||||
|
||||
const std::string m_dbname; /**< Name of the in-memory database */
|
||||
const std::string m_tablename; /**< The table where users are stored */
|
||||
|
||||
private:
|
||||
PamInstance(sqlite3* dbhandle, const std::string& m_dbname, const std::string& tablename);
|
||||
PamInstance(SQLite::SSQLite dbhandle, const std::string& dbname);
|
||||
bool prepare_tables();
|
||||
|
||||
void add_pam_user(const char* user, const char* host, const char* db, bool anydb,
|
||||
const char* pam_service, bool proxy);
|
||||
void delete_old_users();
|
||||
bool fetch_anon_proxy_users(SERVER* server, MYSQL* conn);
|
||||
|
||||
sqlite3* const m_dbhandle; /**< SQLite3 database handle */
|
||||
SQLite::SSQLite const m_sqlite; /**< SQLite3 database handle */
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user