fix: shell quote user-provided mailer path (#999)
This commit is contained in:
parent
716be9edc7
commit
d937c2e1b8
@ -2292,13 +2292,17 @@ static bool SendEmailInternal(const char*dest, const char *subject,
|
|||||||
subject, body, dest);
|
subject, body, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
string logmailer = FLAGS_logmailer;
|
string logmailer;
|
||||||
if (logmailer.empty()) {
|
|
||||||
|
if (FLAGS_logmailer.empty()) {
|
||||||
|
// Don't need to shell escape the literal string
|
||||||
logmailer = "/bin/mail";
|
logmailer = "/bin/mail";
|
||||||
|
} else {
|
||||||
|
logmailer = ShellEscape(FLAGS_logmailer);
|
||||||
}
|
}
|
||||||
|
|
||||||
string cmd =
|
string cmd =
|
||||||
logmailer + " -s" +
|
logmailer + " -s" + ShellEscape(subject) + " " + ShellEscape(dest);
|
||||||
ShellEscape(subject) + " " + ShellEscape(dest);
|
|
||||||
if (use_logging) {
|
if (use_logging) {
|
||||||
VLOG(4) << "Mailing command: " << cmd;
|
VLOG(4) << "Mailing command: " << cmd;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user