[asterisk-bugs] [Asterisk 0014190]: POST files are not truncated

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Jan 13 17:05:44 CST 2009


The following issue has been RESOLVED. 
====================================================================== 
http://bugs.digium.com/view.php?id=14190 
====================================================================== 
Reported By:                timking
Assigned To:                otherwiseguy
====================================================================== 
Project:                    Asterisk
Issue ID:                   14190
Category:                   Core/HTTP
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     resolved
Asterisk Version:           1.6.1-beta4 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): 1.6.1 
SVN Revision (number only!): 167416 
Disclaimer on File?:        N/A 
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-01-07 11:14 CST
Last Modified:              2009-01-13 17:05 CST
====================================================================== 
Summary:                    POST files are not truncated
Description: 
If you use the POST files facility in 1.6.0.3-rc1 (in pbx/http.c), or
1.6.1-beta4 or the latest revision (in res/res_http_post.c) then the file
to be written is opened O_CREAT | O_WRONLY.

Surely this is wrong - don't you mean O_CREAT | O_WRONLY | O_TRUNC ? As it
is, replacing a long file with a shorter one ends up with the previous
contents on the end.
====================================================================== 

---------------------------------------------------------------------- 
 (0097675) svnbot (reporter) - 2009-01-13 17:05
 http://bugs.digium.com/view.php?id=14190#c97675 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 168588

U   trunk/res/res_http_post.c

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

Don't append to a file that already exists on upload

(closes issue http://bugs.digium.com/view.php?id=14190)
Reported by: timking

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=168588 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-01-13 17:05 svnbot         Checkin                                      
2009-01-13 17:05 svnbot         Note Added: 0097675                          
2009-01-13 17:05 svnbot         Status                   acknowledged =>
resolved
2009-01-13 17:05 svnbot         Resolution               open => fixed       
======================================================================




More information about the asterisk-bugs mailing list