mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge with 4.1
This commit is contained in:
@ -1057,6 +1057,7 @@ ulong acl_get(const char *host, const char *ip,
|
||||
db_access=0; host_access= ~0;
|
||||
char key[ACL_KEY_LENGTH],*tmp_db,*end;
|
||||
acl_entry *entry;
|
||||
DBUG_ENTER("acl_get");
|
||||
|
||||
VOID(pthread_mutex_lock(&acl_cache->lock));
|
||||
end=strmov((tmp_db=strmov(strmov(key, ip ? ip : "")+1,user)+1),db);
|
||||
@ -1070,7 +1071,8 @@ ulong acl_get(const char *host, const char *ip,
|
||||
{
|
||||
db_access=entry->access;
|
||||
VOID(pthread_mutex_unlock(&acl_cache->lock));
|
||||
return db_access;
|
||||
DBUG_PRINT("exit", ("access: 0x%lx", db_access));
|
||||
DBUG_RETURN(db_access);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1122,7 +1124,8 @@ exit:
|
||||
acl_cache->add(entry);
|
||||
}
|
||||
VOID(pthread_mutex_unlock(&acl_cache->lock));
|
||||
return (db_access & host_access);
|
||||
DBUG_PRINT("exit", ("access: 0x%lx", db_access & host_access));
|
||||
DBUG_RETURN(db_access & host_access);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1798,7 +1801,7 @@ static int replace_db_table(TABLE *table, const char *db,
|
||||
goto table_error; /* purecov: deadcode */
|
||||
}
|
||||
}
|
||||
else if ((error=table->file->write_row(table->record[0])))
|
||||
else if (rights && (error=table->file->write_row(table->record[0])))
|
||||
{
|
||||
if (error && error != HA_ERR_FOUND_DUPP_KEY) /* purecov: inspected */
|
||||
goto table_error; /* purecov: deadcode */
|
||||
@ -1808,6 +1811,7 @@ static int replace_db_table(TABLE *table, const char *db,
|
||||
if (old_row_exists)
|
||||
acl_update_db(combo.user.str,combo.host.str,db,rights);
|
||||
else
|
||||
if (rights)
|
||||
acl_insert_db(combo.user.str,combo.host.str,db,rights);
|
||||
DBUG_RETURN(0);
|
||||
|
||||
|
Reference in New Issue
Block a user