[asterisk-commits] twilson: trunk r168588 - /trunk/res/res_http_post.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 13 17:05:43 CST 2009


Author: twilson
Date: Tue Jan 13 17:05:43 2009
New Revision: 168588

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168588
Log:
Don't append to a file that already exists on upload

(closes issue #14190)
Reported by: timking

Modified:
    trunk/res/res_http_post.c

Modified: trunk/res/res_http_post.c
URL: http://svn.digium.com/svn-view/asterisk/trunk/res/res_http_post.c?view=diff&rev=168588&r1=168587&r2=168588
==============================================================================
--- trunk/res/res_http_post.c (original)
+++ trunk/res/res_http_post.c Tue Jan 13 17:05:43 2009
@@ -72,7 +72,7 @@
 
 	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;




More information about the asterisk-commits mailing list