X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/1347f3d1e04bedd1508589173f577673ee2c5554..cd22a6554a8c6d917306304aeaf5d2b7a9d99ae4:/projects/stargazer/plugins/store/postgresql/postgresql_store_admins.cpp diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store_admins.cpp b/projects/stargazer/plugins/store/postgresql/postgresql_store_admins.cpp index 1e9db12d..b000aa29 100644 --- a/projects/stargazer/plugins/store/postgresql/postgresql_store_admins.cpp +++ b/projects/stargazer/plugins/store/postgresql/postgresql_store_admins.cpp @@ -42,7 +42,7 @@ //----------------------------------------------------------------------------- int POSTGRESQL_STORE::GetAdminsList(std::vector * adminsList) const { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); if (PQstatus(connection) != CONNECTION_OK) { @@ -98,7 +98,7 @@ return 0; //----------------------------------------------------------------------------- int POSTGRESQL_STORE::SaveAdmin(const ADMIN_CONF & ac) const { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); if (PQstatus(connection) != CONNECTION_OK) { @@ -126,10 +126,10 @@ BLOWFISH_CTX ctx; memset(cryptedPass, 0, ADM_PASSWD_LEN + 1); strncpy(adminPass, ac.password.c_str(), ADM_PASSWD_LEN); -EnDecodeInit(adm_enc_passwd, sizeof(adm_enc_passwd), &ctx); +InitContext(adm_enc_passwd, sizeof(adm_enc_passwd), &ctx); for (int i = 0; i < ADM_PASSWD_LEN / 8; i++) - EncodeString(cryptedPass + 8 * i, adminPass + 8 * i, &ctx); + EncryptBlock(cryptedPass + 8 * i, adminPass + 8 * i, &ctx); cryptedPass[ADM_PASSWD_LEN] = 0; Encode12(encodedPass, cryptedPass, ADM_PASSWD_LEN); @@ -197,7 +197,7 @@ return 0; //----------------------------------------------------------------------------- int POSTGRESQL_STORE::RestoreAdmin(ADMIN_CONF * ac, const std::string & login) const { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); if (PQstatus(connection) != CONNECTION_OK) { @@ -306,10 +306,10 @@ if (ac->password == "") } Decode21(cryptedPass, ac->password.c_str()); -EnDecodeInit(adm_enc_passwd, sizeof(adm_enc_passwd), &ctx); +InitContext(adm_enc_passwd, sizeof(adm_enc_passwd), &ctx); for (int i = 0; i < ADM_PASSWD_LEN / 8; i++) { - DecodeString(adminPass + 8 * i, cryptedPass + 8 * i, &ctx); + DecryptBlock(adminPass + 8 * i, cryptedPass + 8 * i, &ctx); } ac->password = adminPass; @@ -318,7 +318,7 @@ return 0; //----------------------------------------------------------------------------- int POSTGRESQL_STORE::AddAdmin(const std::string & login) const { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); if (PQstatus(connection) != CONNECTION_OK) { @@ -388,7 +388,7 @@ return 0; //----------------------------------------------------------------------------- int POSTGRESQL_STORE::DelAdmin(const std::string & login) const { -STG_LOCKER lock(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex); if (PQstatus(connection) != CONNECTION_OK) {