8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 06:43:04 +01:00

A couple of improvements/cleanups, suggested by Adriano

This commit is contained in:
alexpeshkoff 2006-12-10 11:17:50 +00:00
parent 2070c756f5
commit 6b537af439
7 changed files with 33 additions and 33 deletions

View File

@ -326,7 +326,7 @@ int common_main(int argc,
if (--argc <= 0) {
ALICE_error(13); // msg 13: user name required
}
tdgbl->ALICE_data.ua_tr_user = (UCHAR*)(*argv++);
tdgbl->ALICE_data.ua_tr_user = *argv++;
continue;
}
#endif
@ -471,14 +471,14 @@ int common_main(int argc,
if (--argc <= 0) {
ALICE_error(13); // msg 13: user name required
}
tdgbl->ALICE_data.ua_user = reinterpret_cast<const UCHAR*>(*argv++);
tdgbl->ALICE_data.ua_user = *argv++;
}
if (table->in_sw_value & sw_password) {
if (--argc <= 0) {
ALICE_error(14); // msg 14: password required
}
tdgbl->ALICE_data.ua_password = reinterpret_cast<const UCHAR*>(*argv++);
tdgbl->ALICE_data.ua_password = *argv++;
}
if (table->in_sw_value & sw_disable) {

View File

@ -58,10 +58,10 @@ enum alice_shut_mode {
struct user_action
{
ULONG ua_switches;
const UCHAR* ua_user;
const UCHAR* ua_password;
const char* ua_user;
const char* ua_password;
#ifdef TRUSTED_SERVICES
UCHAR* ua_tr_user;
const char* ua_tr_user;
#endif
bool ua_use;
bool ua_force;

View File

@ -312,21 +312,21 @@ static void buildDpb(Firebird::ClumpletWriter& dpb, const ULONG switches)
}
if (tdgbl->ALICE_data.ua_user) {
dpb.insertBytes(isc_dpb_user_name,
tdgbl->ALICE_data.ua_user,
strlen(reinterpret_cast<const char*>(tdgbl->ALICE_data.ua_user)));
dpb.insertString(isc_dpb_user_name,
tdgbl->ALICE_data.ua_user,
strlen(tdgbl->ALICE_data.ua_user));
}
if (tdgbl->ALICE_data.ua_password) {
dpb.insertBytes(tdgbl->sw_service ? isc_dpb_password_enc :
isc_dpb_password,
tdgbl->ALICE_data.ua_password,
strlen(reinterpret_cast<const char*>(tdgbl->ALICE_data.ua_password)));
dpb.insertString(tdgbl->sw_service ? isc_dpb_password_enc :
isc_dpb_password,
tdgbl->ALICE_data.ua_password,
strlen(tdgbl->ALICE_data.ua_password));
}
#ifdef TRUSTED_SERVICES
if (tdgbl->ALICE_data.ua_tr_user) {
dpb.insertBytes(isc_dpb_trusted_auth,
tdgbl->ALICE_data.ua_tr_user,
strlen(reinterpret_cast<const char*>(tdgbl->ALICE_data.ua_tr_user)));
dpb.insertString(isc_dpb_trusted_auth,
tdgbl->ALICE_data.ua_tr_user,
strlen(tdgbl->ALICE_data.ua_tr_user));
}
#endif
}

View File

@ -192,19 +192,19 @@ bool TDR_attach_database(ISC_STATUS* status_vector,
dpb.insertTag(isc_dpb_no_garbage_collect);
dpb.insertTag(isc_dpb_gfix_attach);
if (tdgbl->ALICE_data.ua_user) {
dpb.insertBytes(isc_dpb_user_name,
dpb.insertString(isc_dpb_user_name,
tdgbl->ALICE_data.ua_user,
strlen(reinterpret_cast<const char*>(tdgbl->ALICE_data.ua_user)));
strlen(tdgbl->ALICE_data.ua_user));
}
if (tdgbl->ALICE_data.ua_password) {
dpb.insertBytes(tdgbl->sw_service ? isc_dpb_password_enc :
dpb.insertString(tdgbl->sw_service ? isc_dpb_password_enc :
isc_dpb_password,
tdgbl->ALICE_data.ua_password,
strlen(reinterpret_cast<const char*>(tdgbl->ALICE_data.ua_password)));
strlen(tdgbl->ALICE_data.ua_password));
}
#ifdef TRUSTED_SERVICES
if (tdgbl->ALICE_data.ua_tr_user) {
dpb.insertBytes(isc_dpb_trusted_auth,
dpb.insertString(isc_dpb_trusted_auth,
tdgbl->ALICE_data.ua_tr_user,
strlen(reinterpret_cast<const char*>(tdgbl->ALICE_data.ua_tr_user)));
}

View File

@ -372,7 +372,7 @@ TEXT* ISC_get_host(TEXT* string, USHORT length)
#endif
#ifdef UNIX
int ISC_get_user(TEXT* name,
bool ISC_get_user(TEXT* name,
int* id,
int* group,
TEXT* project,
@ -449,7 +449,7 @@ int ISC_get_user(TEXT* name,
#ifdef VMS
int ISC_get_user(
bool ISC_get_user(
TEXT* name,
int* id,
int* group,
@ -551,7 +551,7 @@ int ISC_get_user(
#endif
#ifdef WIN_NT
int ISC_get_user(TEXT* name,
bool ISC_get_user(TEXT* name,
int* id,
int* group,
TEXT* project,

View File

@ -33,8 +33,8 @@ bool ISC_check_process_existence(SLONG, SLONG, bool);
//void ISC_get_config(TEXT *, struct ipccfg *);
//int ISC_set_config(TEXT *, struct ipccfg *);
TEXT* ISC_get_host(TEXT *, USHORT);
int ISC_get_user(TEXT*, int*, int*, TEXT*,
TEXT*, int*, const TEXT*);
bool ISC_get_user(TEXT*, int*, int*, TEXT*,
TEXT*, int*, const TEXT*);
SLONG ISC_get_user_group_id(const TEXT*);
void ISC_set_user(const TEXT*);
SLONG ISC_get_prefix(const TEXT*);

View File

@ -596,13 +596,13 @@ void SCL_init(bool create,
#else
bool wheel = false;
if (!user_name) {
wheel = (bool) ISC_get_user(name,
&id,
&group,
project,
organization,
&node_id,
sys_user_name);
wheel = ISC_get_user(name,
&id,
&group,
project,
organization,
&node_id,
sys_user_name);
}
if (user_name || (id == -1))