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
ad0b92f9
Commit
ad0b92f9
authored
Jun 01, 2001
by
sasha@mysql.sashanet.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not show user/pass for slave unless running with show-slave-auth-info
cleanup of register_slave_on_master()
parent
68adfd23
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
24 deletions
+30
-24
mysql-test/r/rpl000002.result
mysql-test/r/rpl000002.result
+2
-2
sql/mysqld.cc
sql/mysqld.cc
+10
-3
sql/slave.cc
sql/slave.cc
+7
-15
sql/sql_repl.cc
sql/sql_repl.cc
+10
-4
sql/sql_repl.h
sql/sql_repl.h
+1
-0
No files found.
mysql-test/r/rpl000002.result
View file @
ad0b92f9
...
...
@@ -2,8 +2,8 @@ n
2000
2001
2002
Server_id Host
User Password
Port
2 127.0.0.1
root
9307
Server_id Host Port
2 127.0.0.1 9307
id created
1 1970-01-01 06:25:45
id created
...
...
sql/mysqld.cc
View file @
ad0b92f9
...
...
@@ -222,7 +222,8 @@ static bool opt_log,opt_update_log,opt_bin_log,opt_slow_log,opt_noacl,
opt_disable_networking
=
0
,
opt_bootstrap
=
0
,
opt_skip_show_db
=
0
,
opt_ansi_mode
=
0
,
opt_myisam_log
=
0
,
opt_large_files
=
sizeof
(
my_off_t
)
>
4
;
bool
opt_sql_bin_update
=
0
,
opt_log_slave_updates
=
0
,
opt_safe_show_db
=
0
;
bool
opt_sql_bin_update
=
0
,
opt_log_slave_updates
=
0
,
opt_safe_show_db
=
0
,
opt_show_slave_auth_info
=
0
;
FILE
*
bootstrap_file
=
0
;
int
segfaulted
=
0
;
// ensure we do not enter SIGSEGV handler twice
extern
MASTER_INFO
glob_mi
;
...
...
@@ -277,7 +278,7 @@ volatile ulong cached_thread_count=0;
// replication parameters, if master_host is not NULL, we are a slave
my_string
master_user
=
(
char
*
)
"test"
,
master_password
=
0
,
master_host
=
0
,
master_info_file
=
(
char
*
)
"master.info"
;
my_string
report_user
=
(
char
*
)
"test"
,
report_password
=
0
,
report_host
=
0
;
my_string
report_user
=
0
,
report_password
=
0
,
report_host
=
0
;
const
char
*
localhost
=
LOCAL_HOST
;
const
char
*
delayed_user
=
"DELAYED"
;
...
...
@@ -2485,7 +2486,8 @@ enum options {
OPT_GEMINI_FLUSH_LOG
,
OPT_GEMINI_RECOVER
,
OPT_GEMINI_UNBUFFERED_IO
,
OPT_SKIP_SAFEMALLOC
,
OPT_SKIP_STACK_TRACE
,
OPT_SKIP_SYMLINKS
,
OPT_REPORT_HOST
,
OPT_REPORT_USER
,
OPT_REPORT_PASSWORD
,
OPT_REPORT_PORT
OPT_REPORT_USER
,
OPT_REPORT_PASSWORD
,
OPT_REPORT_PORT
,
OPT_SHOW_SLAVE_AUTH_INFO
};
static
struct
option
long_options
[]
=
{
...
...
@@ -2604,6 +2606,8 @@ static struct option long_options[] = {
{
"socket"
,
required_argument
,
0
,
(
int
)
OPT_SOCKET
},
{
"server-id"
,
required_argument
,
0
,
(
int
)
OPT_SERVER_ID
},
{
"set-variable"
,
required_argument
,
0
,
'O'
},
{
"show-slave-auth-info"
,
no_argument
,
0
,
(
int
)
OPT_SHOW_SLAVE_AUTH_INFO
},
{
"skip-bdb"
,
no_argument
,
0
,
(
int
)
OPT_BDB_SKIP
},
{
"skip-innodb"
,
no_argument
,
0
,
(
int
)
OPT_INNODB_SKIP
},
{
"skip-gemini"
,
no_argument
,
0
,
(
int
)
OPT_GEMINI_SKIP
},
...
...
@@ -3255,6 +3259,9 @@ static void get_options(int argc,char **argv)
safemalloc_mem_limit
=
atoi
(
optarg
);
#endif
break
;
case
OPT_SHOW_SLAVE_AUTH_INFO
:
opt_show_slave_auth_info
=
1
;
break
;
case
OPT_SOCKET
:
mysql_unix_port
=
optarg
;
break
;
...
...
sql/slave.cc
View file @
ad0b92f9
...
...
@@ -580,24 +580,16 @@ int register_slave_on_master(MYSQL* mysql)
int4store
(
buf
,
server_id
);
packet
.
append
(
buf
,
4
);
len
=
strlen
(
report_host
);
packet
.
append
((
char
)(
uchar
)
len
);
packet
.
append
(
report_host
,
len
);
len
=
strlen
(
report_user
);
packet
.
append
((
char
)(
uchar
)
len
);
packet
.
append
(
report_user
,
len
);
net_store_data
(
&
packet
,
report_host
);
if
(
report_user
)
net_store_data
(
&
packet
,
report_user
);
else
packet
.
append
((
char
)
0
);
if
(
report_password
)
{
len
=
strlen
(
report_password
);
packet
.
append
((
char
)(
uchar
)
len
);
packet
.
append
(
report_password
,
len
);
}
net_store_data
(
&
packet
,
report_user
);
else
{
packet
.
append
((
char
)
0
);
}
int2store
(
buf
,
(
uint16
)
report_port
);
packet
.
append
(
buf
,
2
);
...
...
sql/sql_repl.cc
View file @
ad0b92f9
...
...
@@ -830,8 +830,11 @@ int show_slave_hosts(THD* thd)
List
<
Item
>
field_list
;
field_list
.
push_back
(
new
Item_empty_string
(
"Server_id"
,
20
));
field_list
.
push_back
(
new
Item_empty_string
(
"Host"
,
20
));
field_list
.
push_back
(
new
Item_empty_string
(
"User"
,
20
));
field_list
.
push_back
(
new
Item_empty_string
(
"Password"
,
20
));
if
(
opt_show_slave_auth_info
)
{
field_list
.
push_back
(
new
Item_empty_string
(
"User"
,
20
));
field_list
.
push_back
(
new
Item_empty_string
(
"Password"
,
20
));
}
field_list
.
push_back
(
new
Item_empty_string
(
"Port"
,
20
));
if
(
send_fields
(
thd
,
field_list
,
1
))
...
...
@@ -848,8 +851,11 @@ int show_slave_hosts(THD* thd)
packet
->
length
(
0
);
net_store_data
(
packet
,
si
->
server_id
);
net_store_data
(
packet
,
si
->
host
);
net_store_data
(
packet
,
si
->
user
);
net_store_data
(
packet
,
si
->
password
);
if
(
opt_show_slave_auth_info
)
{
net_store_data
(
packet
,
si
->
user
);
net_store_data
(
packet
,
si
->
password
);
}
net_store_data
(
packet
,
(
uint
)
si
->
port
);
if
(
my_net_write
(
net
,
(
char
*
)
packet
->
ptr
(),
packet
->
length
()))
{
...
...
sql/sql_repl.h
View file @
ad0b92f9
...
...
@@ -12,6 +12,7 @@ typedef struct st_slave_info
uint16
port
;
}
SLAVE_INFO
;
extern
bool
opt_show_slave_auth_info
;
extern
HASH
slave_list
;
extern
char
*
master_host
;
extern
my_string
opt_bin_logname
,
master_info_file
;
...
...
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