8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 00:03:03 +01:00
This commit is contained in:
robocop 2009-12-01 12:32:31 +00:00
parent fa15710b89
commit c81b21a160

View File

@ -82,7 +82,8 @@ static inline void check_and_move(UCHAR from, Acl& to)
to.push(from);
}
struct P_NAMES {
struct P_NAMES
{
SecurityClass::flags_t p_names_priv;
USHORT p_names_acl;
const TEXT* p_names_string;
@ -185,12 +186,14 @@ void SCL_check_access(thread_db* tdbb,
}
}
if (denied_db) {
if (denied_db)
{
ERR_post(Arg::Gds(isc_no_priv) << Arg::Str(names->p_names_string) <<
Arg::Str("DATABASE") <<
Arg::Str(""));
}
else {
else
{
ERR_post(Arg::Gds(isc_no_priv) << Arg::Str(names->p_names_string) <<
Arg::Str(type) <<
Arg::Str(name));
@ -276,7 +279,8 @@ void SCL_check_index(thread_db* tdbb, const Firebird::MetaName& index_name, UCHA
// No need to cache this request handle, it's only used when
// new constraints are created
if (index_id < 1) {
if (index_id < 1)
{
FOR(REQUEST_HANDLE request) IND IN RDB$INDICES
CROSS REL IN RDB$RELATIONS
OVER RDB$RELATION_NAME
@ -291,7 +295,8 @@ void SCL_check_index(thread_db* tdbb, const Firebird::MetaName& index_name, UCHA
CMP_release(tdbb, request);
}
else {
else
{
idx_name_ptr = &aux_idx_name;
FOR (REQUEST_HANDLE request) IND IN RDB$INDICES
CROSS REL IN RDB$RELATIONS
@ -359,7 +364,8 @@ void SCL_check_index(thread_db* tdbb, const Firebird::MetaName& index_name, UCHA
CMP_release(tdbb, request);
}
catch (const Firebird::Exception&) {
catch (const Firebird::Exception&)
{
if (request) {
CMP_release(tdbb, request);
}
@ -667,7 +673,8 @@ void SCL_init(thread_db* tdbb, bool create, const UserId& tempId)
// CVC: If we aren't creating a db and sql_role was specified,
// then verify it against rdb$roles and rdb$user_privileges
if (!create && sql_role && *sql_role && strcmp(sql_role, NULL_ROLE)) {
if (!create && sql_role && *sql_role && strcmp(sql_role, NULL_ROLE))
{
bool found = false;
jrd_req* request = CMP_find_request (tdbb, irq_verify_role_name, IRQ_REQUESTS);
@ -726,7 +733,8 @@ void SCL_init(thread_db* tdbb, bool create, const UserId& tempId)
}
}
if (sql_role) {
if (sql_role)
{
if (role_name != NULL_ROLE) {
role_name = sql_role;
}
@ -741,7 +749,8 @@ void SCL_init(thread_db* tdbb, bool create, const UserId& tempId)
user->usr_sql_role_name = role_name.c_str();
attachment->att_user = user;
if (!create) {
if (!create)
{
jrd_req* handle = NULL;
jrd_req* handle1 = NULL;
jrd_req* handle2 = NULL;
@ -1187,6 +1196,7 @@ static SecurityClass::flags_t walk_acl(thread_db* tdbb,
else
{
TEXT login_name[129];
fb_assert(user.usr_user_name.length() < sizeof(login_name));
TEXT* pln = login_name;
const TEXT* q = user.usr_user_name.c_str();
while (*pln++ = UPPER7(*q)) {
@ -1287,9 +1297,7 @@ static SecurityClass::flags_t walk_acl(thread_db* tdbb,
break;
case priv_write:
privilege |=
SCL_write | SCL_sql_insert | SCL_sql_update |
SCL_sql_delete;
privilege |= SCL_write | SCL_sql_insert | SCL_sql_update | SCL_sql_delete;
break;
case priv_sql_insert: