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
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;
}