summaryrefslogtreecommitdiffstats
path: root/tinydns-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2009-01-16 15:28:51 +0000
committerTed Trask <ttrask01@yahoo.com>2009-01-16 15:28:51 +0000
commit82faa5dc652a3890113797e11ec7e57d1bfdcf56 (patch)
tree4ada4a5e73f3ee9405845792c3704dafaf9d648d /tinydns-model.lua
parenta89437b3c168e6d5f38b8e577f31ea89f5c9c8d0 (diff)
downloadacf-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.lua7
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