]> git.ipfire.org Git - thirdparty/asterisk.git/commit
config: Fix ast_config_text_file_save2 writability check for missing files 91/2691/4
authorGeorge Joseph <gjoseph@digium.com>
Mon, 25 Apr 2016 03:51:16 +0000 (21:51 -0600)
committerGeorge Joseph <gjoseph@digium.com>
Mon, 25 Apr 2016 23:16:58 +0000 (18:16 -0500)
commitb38f1146e54f295c89727de4fde150ed731d5b64
tree0eae2d58aeac59b32c7d348bed3765e09991d2bc
parent13ee3402ed8e22fa9d4cfbe8750db3d0b4461935
config:  Fix ast_config_text_file_save2 writability check for missing files

A patch I did back in 2014 modified ast_config_text_file_save2 to check the
writability of the main file and include files before truncating and re-writing
them.  An unintended side-effect of this was that if a file doesn't exist,
the check fails and the write is aborted.

This patch causes ast_config_text_file_save2 to check the writability of the
parent directory of missing files instead of checking the file itself.  This
allows missing files to be created again.  A unit test was also added to
test_config to test saving of config files.

The regression was discovered when app_voicemail's passwordlocation=spooldir
feature stopped working.

ASTERISK-25917 #close
Reported-by: Jonathan Rose
Change-Id: Ic4dbe58c277a47b674679e49daed5fc6de349f80
main/config.c
tests/test_config.c