Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
dd860ba3
Commit
dd860ba3
authored
Oct 24, 2003
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-4.1/
into serg.mylan:/usr/home/serg/Abk/mysql-4.1-bug
parents
0ad0c8ff
c752d2ca
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
14 deletions
+11
-14
sql/sql_acl.cc
sql/sql_acl.cc
+5
-5
sql/sql_acl.h
sql/sql_acl.h
+1
-1
sql/sql_db.cc
sql/sql_db.cc
+2
-4
sql/sql_parse.cc
sql/sql_parse.cc
+2
-2
sql/sql_show.cc
sql/sql_show.cc
+1
-2
No files found.
sql/sql_acl.cc
View file @
dd860ba3
...
...
@@ -52,7 +52,8 @@ static byte* acl_entry_get_key(acl_entry *entry,uint *length,
return
(
byte
*
)
entry
->
key
;
}
#define ACL_KEY_LENGTH (sizeof(long)+NAME_LEN+USERNAME_LENGTH+1)
#define IP_ADDR_STRLEN
#define ACL_KEY_LENGTH (IP_ADDR_STRLEN+1+NAME_LEN+1+USERNAME_LENGTH+1)
static
DYNAMIC_ARRAY
acl_hosts
,
acl_users
,
acl_dbs
;
static
MEM_ROOT
mem
,
memex
;
...
...
@@ -909,7 +910,7 @@ static void acl_insert_db(const char *user, const char *host, const char *db,
Get privilege for a host, user and db combination
*/
ulong
acl_get
(
const
char
*
host
,
const
char
*
ip
,
const
char
*
bin_ip
,
ulong
acl_get
(
const
char
*
host
,
const
char
*
ip
,
const
char
*
user
,
const
char
*
db
,
my_bool
db_is_pattern
)
{
ulong
host_access
,
db_access
;
...
...
@@ -919,8 +920,7 @@ ulong acl_get(const char *host, const char *ip, const char *bin_ip,
acl_entry
*
entry
;
VOID
(
pthread_mutex_lock
(
&
acl_cache
->
lock
));
memcpy_fixed
(
&
key
,
bin_ip
,
sizeof
(
struct
in_addr
));
end
=
strmov
((
tmp_db
=
strmov
(
key
+
sizeof
(
struct
in_addr
),
user
)
+
1
),
db
);
end
=
strmov
((
tmp_db
=
strmov
(
strmov
(
key
,
ip
?
ip
:
""
)
+
1
,
user
)
+
1
),
db
);
if
(
lower_case_table_names
)
{
my_casedn_str
(
&
my_charset_latin1
,
tmp_db
);
...
...
@@ -1331,7 +1331,7 @@ static bool test_if_create_new_users(THD *thd)
bzero
((
char
*
)
&
tl
,
sizeof
(
tl
));
tl
.
db
=
(
char
*
)
"mysql"
;
tl
.
real_name
=
(
char
*
)
"user"
;
db_access
=
acl_get
(
thd
->
host
,
thd
->
ip
,
(
char
*
)
&
thd
->
remote
.
sin_addr
,
db_access
=
acl_get
(
thd
->
host
,
thd
->
ip
,
thd
->
priv_user
,
tl
.
db
,
0
);
if
(
!
(
db_access
&
INSERT_ACL
))
{
...
...
sql/sql_acl.h
View file @
dd860ba3
...
...
@@ -134,7 +134,7 @@ public:
my_bool
acl_init
(
THD
*
thd
,
bool
dont_read_acl_tables
);
void
acl_reload
(
THD
*
thd
);
void
acl_free
(
bool
end
=
0
);
ulong
acl_get
(
const
char
*
host
,
const
char
*
ip
,
const
char
*
bin_ip
,
ulong
acl_get
(
const
char
*
host
,
const
char
*
ip
,
const
char
*
user
,
const
char
*
db
,
my_bool
db_is_pattern
);
int
acl_getroot
(
THD
*
thd
,
USER_RESOURCES
*
mqh
,
const
char
*
passwd
,
uint
passwd_len
);
...
...
sql/sql_db.cc
View file @
dd860ba3
...
...
@@ -618,8 +618,7 @@ bool mysql_change_db(THD *thd, const char *name)
if
(
test_all_bits
(
thd
->
master_access
,
DB_ACLS
))
db_access
=
DB_ACLS
;
else
db_access
=
(
acl_get
(
thd
->
host
,
thd
->
ip
,(
char
*
)
&
thd
->
remote
.
sin_addr
,
thd
->
priv_user
,
dbname
,
0
)
|
db_access
=
(
acl_get
(
thd
->
host
,
thd
->
ip
,
thd
->
priv_user
,
dbname
,
0
)
|
thd
->
master_access
);
if
(
!
(
db_access
&
DB_ACLS
)
&&
(
!
grant_option
||
check_grant_db
(
thd
,
dbname
)))
{
...
...
@@ -684,8 +683,7 @@ int mysqld_show_create_db(THD *thd, char *dbname,
if
(
test_all_bits
(
thd
->
master_access
,
DB_ACLS
))
db_access
=
DB_ACLS
;
else
db_access
=
(
acl_get
(
thd
->
host
,
thd
->
ip
,(
char
*
)
&
thd
->
remote
.
sin_addr
,
thd
->
priv_user
,
dbname
,
0
)
|
db_access
=
(
acl_get
(
thd
->
host
,
thd
->
ip
,
thd
->
priv_user
,
dbname
,
0
)
|
thd
->
master_access
);
if
(
!
(
db_access
&
DB_ACLS
)
&&
(
!
grant_option
||
check_grant_db
(
thd
,
dbname
)))
{
...
...
sql/sql_parse.cc
View file @
dd860ba3
...
...
@@ -3376,7 +3376,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
db_access
=
thd
->
db_access
;
if
(
!
(
thd
->
master_access
&
SELECT_ACL
)
&&
(
db
&&
(
!
thd
->
db
||
strcmp
(
db
,
thd
->
db
))))
db_access
=
acl_get
(
thd
->
host
,
thd
->
ip
,
(
char
*
)
&
thd
->
remote
.
sin_addr
,
db_access
=
acl_get
(
thd
->
host
,
thd
->
ip
,
thd
->
priv_user
,
db
,
test
(
want_access
&
GRANT_ACL
));
*
save_priv
=
thd
->
master_access
|
db_access
;
DBUG_RETURN
(
FALSE
);
...
...
@@ -3396,7 +3396,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
DBUG_RETURN
(
FALSE
);
// Allow select on anything
if
(
db
&&
(
!
thd
->
db
||
strcmp
(
db
,
thd
->
db
)))
db_access
=
acl_get
(
thd
->
host
,
thd
->
ip
,
(
char
*
)
&
thd
->
remote
.
sin_addr
,
db_access
=
acl_get
(
thd
->
host
,
thd
->
ip
,
thd
->
priv_user
,
db
,
test
(
want_access
&
GRANT_ACL
));
else
db_access
=
thd
->
db_access
;
...
...
sql/sql_show.cc
View file @
dd860ba3
...
...
@@ -75,8 +75,7 @@ mysqld_show_dbs(THD *thd,const char *wild)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if
(
thd
->
master_access
&
(
DB_ACLS
|
SHOW_DB_ACL
)
||
acl_get
(
thd
->
host
,
thd
->
ip
,
(
char
*
)
&
thd
->
remote
.
sin_addr
,
thd
->
priv_user
,
file_name
,
0
)
||
acl_get
(
thd
->
host
,
thd
->
ip
,
thd
->
priv_user
,
file_name
,
0
)
||
(
grant_option
&&
!
check_grant_db
(
thd
,
file_name
)))
#endif
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment