]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 168588 via svnmerge from
authorTerry Wilson <twilson@digium.com>
Tue, 13 Jan 2009 23:11:19 +0000 (23:11 +0000)
committerTerry Wilson <twilson@digium.com>
Tue, 13 Jan 2009 23:11:19 +0000 (23:11 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

........
  r168588 | twilson | 2009-01-13 17:05:43 -0600 (Tue, 13 Jan 2009) | 5 lines

  Fully overwrite a same-named file when uploading

  (closes issue #14190)
  Reported by: timking
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@168589 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/http.c

index 79cfe54594c7442523542779e8213cfc82e1560f..94a82bfcb94bac3c102909856615d14ee655353d 100644 (file)
@@ -386,7 +386,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;
        }