]> git.ipfire.org Git - thirdparty/asterisk.git/commit
config: Fix ast_config_text_file_save writability check for missing files 93/2693/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:18:11 +0000 (18:18 -0500)
commitbd050e2782ee15a814cb0b1878f565510592c9b4
tree4c3325ae3fe8ae152704f4228c73a72fffc1be8a
parent0cc0839f491ba576d37cee597ac150cc1e9c851d
config:  Fix ast_config_text_file_save writability check for missing files

A patch I did back in 2014 modified ast_config_text_file_save 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_save 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