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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
7ba12d42
Commit
7ba12d42
authored
Jun 21, 2024
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-34434 Hide password passed on commandline from xtrabackup_info
refine mariadb-backup password zapping check
parent
d2051816
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
4 deletions
+42
-4
extra/mariabackup/backup_mysql.cc
extra/mariabackup/backup_mysql.cc
+9
-1
mysql-test/suite/mariabackup/backup_grants.result
mysql-test/suite/mariabackup/backup_grants.result
+6
-0
mysql-test/suite/mariabackup/backup_grants.test
mysql-test/suite/mariabackup/backup_grants.test
+27
-3
No files found.
extra/mariabackup/backup_mysql.cc
View file @
7ba12d42
...
...
@@ -1934,9 +1934,17 @@ char *make_argv(char *buf, size_t len, int argc, char **argv)
while
(
argc
>
0
&&
left
>
0
)
{
arg
=
*
argv
;
if
(
strncmp
(
*
argv
,
"--password"
,
strlen
(
"--password
"
))
==
0
)
{
if
(
strncmp
(
*
argv
,
STRING_WITH_LEN
(
"--password=
"
))
==
0
)
{
arg
=
"--password=..."
;
}
else
if
(
strcmp
(
*
argv
,
"--password"
)
==
0
)
{
arg
=
"--password ..."
;
++
argv
;
--
argc
;
}
else
if
(
strncmp
(
*
argv
,
STRING_WITH_LEN
(
"-p"
))
==
0
)
{
arg
=
"-p..."
;
}
uint
l
=
snprintf
(
buf
+
len
-
left
,
left
,
"%s%c"
,
arg
,
argc
>
1
?
' '
:
0
);
++
argv
;
--
argc
;
...
...
mysql-test/suite/mariabackup/backup_grants.result
View file @
7ba12d42
CREATE user backup@localhost IDENTIFIED BY 'xyz';
NOT FOUND /missing required privilege/ in backup.log
NOT FOUND /xyz/ in xtrabackup_info
FOUND 1 /missing required privilege RELOAD/ in backup.log
FOUND 1 /missing required privilege PROCESS/ in backup.log
FOUND 1 /GRANT USAGE ON/ in backup.log
GRANT RELOAD, PROCESS on *.* to backup@localhost;
NOT FOUND /missing required privilege/ in backup.log
NOT FOUND /xyz/ in xtrabackup_info
FOUND 1 /missing required privilege SLAVE MONITOR/ in backup.log
GRANT REPLICA MONITOR ON *.* TO backup@localhost;
NOT FOUND /missing required privilege/ in backup.log
NOT FOUND /xyz/ in xtrabackup_info
REVOKE REPLICA MONITOR ON *.* FROM backup@localhost;
NOT FOUND /xyz/ in xtrabackup_info
FOUND 1 /missing required privilege CONNECTION ADMIN/ in backup.log
GRANT CONNECTION ADMIN ON *.* TO backup@localhost;
NOT FOUND /missing required privilege/ in backup.log
NOT FOUND /xyz/ in xtrabackup_info
FOUND 1 /missing required privilege REPLICATION SLAVE ADMIN/ in backup.log
FOUND 1 /missing required privilege SLAVE MONITOR/ in backup.log
GRANT REPLICATION SLAVE ADMIN ON *.* TO backup@localhost;
GRANT REPLICA MONITOR ON *.* TO backup@localhost;
NOT FOUND /missing required privilege/ in backup.log
NOT FOUND /xyz/ in xtrabackup_info
DROP USER backup@localhost;
mysql-test/suite/mariabackup/backup_grants.test
View file @
7ba12d42
let
$targetdir
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
;
let
$info
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
/
xtrabackup_info
;
let
$log
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
.
log
;
CREATE
user
backup
@
localhost
IDENTIFIED
BY
'xyz'
;
let
SEARCH_FILE
=
$MYSQLTEST_VARDIR
/
tmp
/
backup
.
log
;
# backup possible for unprivileges user, with --no-lock
--
disable_result_log
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
backup
-
ubackup
-
pxyz
--
no
-
lock
--
target
-
dir
=
$targetdir
>
$MYSQLTEST_VARDIR
/
tmp
/
backup
.
log
2
>&
1
;
--
enable_result_log
--
let
SEARCH_FILE
=
$log
--
let
SEARCH_PATTERN
=
missing
required
privilege
--
source
include
/
search_pattern_in_file
.
inc
--
let
SEARCH_FILE
=
$info
--
let
SEARCH_PATTERN
=
xyz
--
source
include
/
search_pattern_in_file
.
inc
rmdir
$targetdir
;
# backup fails without --no-lock, because of FTWRL
...
...
@@ -17,6 +22,7 @@ error 1;
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
backup
-
ubackup
-
pxyz
--
target
-
dir
=
$targetdir
>
$MYSQLTEST_VARDIR
/
tmp
/
backup
.
log
2
>&
1
;
--
enable_result_log
--
let
SEARCH_FILE
=
$log
--
let
SEARCH_PATTERN
=
missing
required
privilege
RELOAD
--
source
include
/
search_pattern_in_file
.
inc
--
let
SEARCH_PATTERN
=
missing
required
privilege
PROCESS
...
...
@@ -30,16 +36,20 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --user=backu
--
enable_result_log
--
let
SEARCH_PATTERN
=
missing
required
privilege
--
source
include
/
search_pattern_in_file
.
inc
--
let
SEARCH_FILE
=
$info
--
let
SEARCH_PATTERN
=
xyz
--
source
include
/
search_pattern_in_file
.
inc
rmdir
$targetdir
;
# MDEV-23607 Warning: missing required privilege REPLICATION CLIENT
# --slave-info and --galera-info require REPLICA MONITOR
--
disable_result_log
error
1
;
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
backup
--
user
backup
--
password
xyz
--
slave
-
info
--
target
-
dir
=
$targetdir
>
$MYSQLTEST_VARDIR
/
tmp
/
backup
.
log
2
>&
1
;
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
backup
--
user
backup
--
password
=
xyz
--
slave
-
info
--
target
-
dir
=
$targetdir
>
$MYSQLTEST_VARDIR
/
tmp
/
backup
.
log
2
>&
1
;
--
enable_result_log
rmdir
$targetdir
;
--
let
SEARCH_FILE
=
$log
--
let
SEARCH_PATTERN
=
missing
required
privilege
SLAVE
MONITOR
--
source
include
/
search_pattern_in_file
.
inc
...
...
@@ -49,6 +59,9 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup -ubackup -pxy
--
enable_result_log
--
let
SEARCH_PATTERN
=
missing
required
privilege
--
source
include
/
search_pattern_in_file
.
inc
--
let
SEARCH_FILE
=
$info
--
let
SEARCH_PATTERN
=
xyz
--
source
include
/
search_pattern_in_file
.
inc
rmdir
$targetdir
;
REVOKE
REPLICA
MONITOR
ON
*.*
FROM
backup
@
localhost
;
...
...
@@ -59,17 +72,24 @@ REVOKE REPLICA MONITOR ON *.* FROM backup@localhost;
--
disable_result_log
--
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
backup
-
ubackup
-
pxyz
--
kill
-
long
-
query
-
type
=
ALL
--
kill
-
long
-
queries
-
timeout
=
4
--
target
-
dir
=
$targetdir
>
$MYSQLTEST_VARDIR
/
tmp
/
backup
.
log
2
>&
1
;
--
enable_result_log
--
let
SEARCH_FILE
=
$info
--
let
SEARCH_PATTERN
=
xyz
--
source
include
/
search_pattern_in_file
.
inc
rmdir
$targetdir
;
--
let
SEARCH_FILE
=
$log
--
let
SEARCH_PATTERN
=
missing
required
privilege
CONNECTION
ADMIN
--
source
include
/
search_pattern_in_file
.
inc
GRANT
CONNECTION
ADMIN
ON
*.*
TO
backup
@
localhost
;
--
disable_result_log
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
backup
-
ubackup
--
password
=
xyz
--
kill
-
long
-
query
-
type
=
all
--
kill
-
long
-
queries
-
timeout
=
1
--
target
-
dir
=
$targetdir
>
$MYSQLTEST_VARDIR
/
tmp
/
backup
.
log
2
>&
1
;
exec
$XTRABACKUP
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
--
backup
-
ubackup
--
password
xyz
--
kill
-
long
-
query
-
type
=
all
--
kill
-
long
-
queries
-
timeout
=
1
--
target
-
dir
=
$targetdir
>
$MYSQLTEST_VARDIR
/
tmp
/
backup
.
log
2
>&
1
;
--
enable_result_log
--
let
SEARCH_PATTERN
=
missing
required
privilege
--
source
include
/
search_pattern_in_file
.
inc
--
let
SEARCH_FILE
=
$info
--
let
SEARCH_PATTERN
=
xyz
--
source
include
/
search_pattern_in_file
.
inc
rmdir
$targetdir
;
# --safe-slave-backup requires REPLICATION SLAVE ADMIN, and REPLICA MONITOR
...
...
@@ -79,6 +99,7 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --user backup
--
enable_result_log
rmdir
$targetdir
;
--
let
SEARCH_FILE
=
$log
--
let
SEARCH_PATTERN
=
missing
required
privilege
REPLICATION
SLAVE
ADMIN
--
source
include
/
search_pattern_in_file
.
inc
--
let
SEARCH_PATTERN
=
missing
required
privilege
SLAVE
MONITOR
...
...
@@ -91,6 +112,9 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup -ubackup -pxy
--
enable_result_log
--
let
SEARCH_PATTERN
=
missing
required
privilege
--
source
include
/
search_pattern_in_file
.
inc
--
let
SEARCH_FILE
=
$info
--
let
SEARCH_PATTERN
=
xyz
--
source
include
/
search_pattern_in_file
.
inc
rmdir
$targetdir
;
DROP
USER
backup
@
localhost
;
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