[asterisk-bugs] [Asterisk 0013341]: [patch] Problem using UpdateConfig AMI command when dstfilename points to non-existing file

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Aug 22 16:05:40 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13341 
====================================================================== 
Reported By:                vadim
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13341
Category:                   Core/ManagerInterface
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.22 
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 135996 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-08-19 08:43 CDT
Last Modified:              2008-08-22 16:05 CDT
====================================================================== 
Summary:                    [patch] Problem using UpdateConfig AMI command when
dstfilename points to non-existing file
Description: 
I'm running following putconfig command:
======
Action: updateconfig
reload: no
SrcFilename: extensions.conf
DstFilename: extensions.conf.new
Action-000000: newcat
Cat-000000: ami-test-01
Action-000001: append
Var-000001: exten
Value-000001: 888,1,Noop(888)
Cat-000001: ami-test-01
Action-000002: append
Var-000002: exten
Value-000002: 999,1,Noop(999)
Cat-000002: ami-test-0
=======
And getting following as result:
============
Response: Error
Message: Save of config failed
============
====================================================================== 

---------------------------------------------------------------------- 
 (0091663) putnopvut (administrator) - 2008-08-22 16:05
 http://bugs.digium.com/view.php?id=13341#c91663 
---------------------------------------------------------------------- 
Ah, nice patch. I think it's important to catch any potential errors on the
unlink call, but only if the file actually exists to be unlinked. In the
spirit of your patch, I've changed the logic a bit so that the return value
of stat() is checked to see if we should actually attempt to unlink.

Could you test to make sure this works, too? 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-08-22 16:05 putnopvut      Note Added: 0091663                          
======================================================================




More information about the asterisk-bugs mailing list