mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-17 15:29:05 +00:00
Fully overwrite a same-named file when uploading
(closes issue #14190) Reported by: timking git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -72,7 +72,7 @@ static void post_raw(GMimePart *part, const char *post_dir, const char *fn)
|
|||||||
|
|
||||||
ast_debug(1, "Posting raw data to %s\n", filename);
|
ast_debug(1, "Posting raw data to %s\n", filename);
|
||||||
|
|
||||||
if ((fd = open(filename, O_CREAT | O_WRONLY, 0666)) == -1) {
|
if ((fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0666)) == -1) {
|
||||||
ast_log(LOG_WARNING, "Unable to open %s for writing file from a POST!\n", filename);
|
ast_log(LOG_WARNING, "Unable to open %s for writing file from a POST!\n", filename);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user