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

1. Pass explicit role to the security database attachment

2. Better error messages - append original error occured in security database after primary error code
This commit is contained in:
hvlad 2009-10-05 10:27:02 +00:00
parent 6fbd82ac71
commit fd15d59ac8

View File

@ -50,6 +50,10 @@ UserManagement::UserManagement(jrd_tra* tra)
{
dpb.insertString(isc_dpb_trusted_role, ADMIN_ROLE, strlen(ADMIN_ROLE));
}
else if (!att->att_user->usr_sql_role_name.empty())
{
dpb.insertString(isc_dpb_trusted_role, att->att_user->usr_sql_role_name);
}
if (isc_attach_database(status, 0, securityDatabaseName, &database,
dpb.getBufferLength(), reinterpret_cast<const char*>(dpb.getBuffer())))
@ -140,10 +144,20 @@ void UserManagement::execute(USHORT id)
case 0: // nothing
break;
case GsecMsg22:
status_exception::raise(Arg::Gds(ENCODE_ISC_MSG(errcode, GSEC_MSG_FAC)) <<
Arg::Str(commands[id]->user_name));
{
Arg::StatusVector tmp;
tmp << Arg::Gds(ENCODE_ISC_MSG(errcode, GSEC_MSG_FAC)) << Arg::Str(commands[id]->user_name);
tmp.append(Arg::StatusVector(&status[0]));
tmp.raise();
}
default:
status_exception::raise(Arg::Gds(ENCODE_ISC_MSG(errcode, GSEC_MSG_FAC)));
{
Arg::StatusVector tmp;
tmp << Arg::Gds(ENCODE_ISC_MSG(errcode, GSEC_MSG_FAC));
tmp.append(Arg::StatusVector(&status[0]));
tmp.raise();
}
}
delete commands[id];