config rewrite failed save errno in case of being tainted (#10461)
errno would be potentially tainted during the serverLog() by the file io functions, such as fopen and fflush.
This commit is contained in:
parent
4517fadb59
commit
93dda65354
@ -3033,8 +3033,10 @@ void configRewriteCommand(client *c) {
|
||||
return;
|
||||
}
|
||||
if (rewriteConfig(server.configfile, 0) == -1) {
|
||||
serverLog(LL_WARNING,"CONFIG REWRITE failed: %s", strerror(errno));
|
||||
addReplyErrorFormat(c,"Rewriting config file: %s", strerror(errno));
|
||||
/* save errno in case of being tainted. */
|
||||
int err = errno;
|
||||
serverLog(LL_WARNING,"CONFIG REWRITE failed: %s", strerror(err));
|
||||
addReplyErrorFormat(c,"Rewriting config file: %s", strerror(err));
|
||||
} else {
|
||||
serverLog(LL_WARNING,"CONFIG REWRITE executed with success.");
|
||||
addReply(c,shared.ok);
|
||||
|
Loading…
x
Reference in New Issue
Block a user