diff options
author | Terry Wilson <twilson@digium.com> | 2009-01-13 23:05:43 +0000 |
---|---|---|
committer | Terry Wilson <twilson@digium.com> | 2009-01-13 23:05:43 +0000 |
commit | 60b435ce4eb2f6d1a6558d9404ccc1dada70163d (patch) | |
tree | 8449d434db4f756cea325241919fe3a95c52e13a /res/res_http_post.c | |
parent | 7c6d9c72353d27355a1012cdd4d151e8a8f15d73 (diff) |
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
Diffstat (limited to 'res/res_http_post.c')
-rw-r--r-- | res/res_http_post.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_http_post.c b/res/res_http_post.c index 2770f52d8..9c8e06de5 100644 --- a/res/res_http_post.c +++ b/res/res_http_post.c @@ -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); - 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); return; |