diff options
author | Ted Trask <ttrask01@yahoo.com> | 2009-01-16 15:28:51 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2009-01-16 15:28:51 +0000 |
commit | 82faa5dc652a3890113797e11ec7e57d1bfdcf56 (patch) | |
tree | 4ada4a5e73f3ee9405845792c3704dafaf9d648d /tinydns-model.lua | |
parent | a89437b3c168e6d5f38b8e577f31ea89f5c9c8d0 (diff) | |
download | acf-tinydns-82faa5dc652a3890113797e11ec7e57d1bfdcf56.tar.bz2 acf-tinydns-82faa5dc652a3890113797e11ec7e57d1bfdcf56.tar.xz |
Fixed tinydns bug caused by 1596 with write_file_with_audit, fixed bug in creating file when directory missing.
git-svn-id: svn://svn.alpinelinux.org/acf/tinydns/trunk@1680 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'tinydns-model.lua')
-rw-r--r-- | tinydns-model.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tinydns-model.lua b/tinydns-model.lua index 0fa92f1..6b77acc 100644 --- a/tinydns-model.lua +++ b/tinydns-model.lua @@ -181,13 +181,13 @@ function getconfig() return cfe({ type="group", value=config, label="TinyDNS Configuration" }) end -function setconfig(conf) +function setconfig(self, conf) local test, errtxt = validator.is_ipv4(conf.value.listen.value) if not test then conf.value.listen.errtxt = errtxt conf.errtxt = "Failed to set configuration" else - write_file_with_audit(configfile, format.update_ini_file(fs.read_file(configfile) or "","","IP",conf.value.listen.value)) + modelfunctions.write_file_with_audit(self, configfile, format.update_ini_file(fs.read_file(configfile) or "","","IP",conf.value.listen.value)) end return conf @@ -284,8 +284,7 @@ function createconfigfile(self, configfile, userid) if (posix.stat(path)) then configfile.value.filename.errtxt = "File already exists" else - local file = io.open(path, "w") - file:close() + fs.create_file(path) configfile.errtxt = nil -- We have to add this file to the allowed list, if there is one |