]> git.ipfire.org Git - thirdparty/asterisk.git/commit
config: bug: fix truncation of included config files on permissions error
authorGeorge Joseph <george.joseph@fairview5.com>
Wed, 10 Sep 2014 15:58:45 +0000 (15:58 +0000)
committerGeorge Joseph <george.joseph@fairview5.com>
Wed, 10 Sep 2014 15:58:45 +0000 (15:58 +0000)
commit74f3df57deee681b1e5bd28de7f2401c1e08b2f6
tree9e870ee601e905764912c687f9106413da331cfc
parenta42ac11c12b2c044ea31b322fb51bb3919fd0414
config: bug: fix truncation of included config files on permissions error

ast_config_text_file_save() currently truncates include files as they
are processed.  If a subsequent include file or the main config file has
a permissions error that prevents writing, earlier include files are left
truncated resulting in a frantic search for backups.

This patch causes ast_config_text_file_save to check for write access
on all files before it truncates any of them.

Will be applied 1.8 > trunk.

Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3986/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@422900 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/config.c