Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
aaf56235
Commit
aaf56235
authored
Jul 02, 2013
by
antirez
Browse files
Only allow basenames for dbfilename and appendfilename.
This fixes issue #1094.
parent
25a3ad7f
Changes
1
Show whitespace changes
Inline
Side-by-side
src/config.c
View file @
aaf56235
...
...
@@ -306,6 +306,10 @@ void loadServerConfigFromString(char *config) {
}
server
.
aof_state
=
yes
?
REDIS_AOF_ON
:
REDIS_AOF_OFF
;
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"appendfilename"
)
&&
argc
==
2
)
{
if
(
!
pathIsBaseName
(
argv
[
1
]))
{
err
=
"appendfilename can't be a path, just a filename"
;
goto
loaderr
;
}
zfree
(
server
.
aof_filename
);
server
.
aof_filename
=
zstrdup
(
argv
[
1
]);
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"no-appendfsync-on-rewrite"
)
...
...
@@ -352,6 +356,10 @@ void loadServerConfigFromString(char *config) {
zfree
(
server
.
pidfile
);
server
.
pidfile
=
zstrdup
(
argv
[
1
]);
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"dbfilename"
)
&&
argc
==
2
)
{
if
(
!
pathIsBaseName
(
argv
[
1
]))
{
err
=
"dbfilename can't be a path, just a filename"
;
goto
loaderr
;
}
zfree
(
server
.
rdb_filename
);
server
.
rdb_filename
=
zstrdup
(
argv
[
1
]);
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"hash-max-ziplist-entries"
)
&&
argc
==
2
)
{
...
...
@@ -522,6 +530,10 @@ void configSetCommand(redisClient *c) {
o
=
c
->
argv
[
3
];
if
(
!
strcasecmp
(
c
->
argv
[
2
]
->
ptr
,
"dbfilename"
))
{
if
(
!
pathIsBaseName
(
o
->
ptr
))
{
addReplyError
(
c
,
"dbfilename can't be a path, just a filename"
);
return
;
}
zfree
(
server
.
rdb_filename
);
server
.
rdb_filename
=
zstrdup
(
o
->
ptr
);
}
else
if
(
!
strcasecmp
(
c
->
argv
[
2
]
->
ptr
,
"requirepass"
))
{
...
...
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