summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2009-01-13 16:01:06 +0000
committerTed Trask <ttrask01@yahoo.com>2009-01-13 16:01:06 +0000
commit053d0e601f366d04dc78521496eeea2c8e229ba5 (patch)
tree5b7ce83d0bccb5b6006e6028889f0a1fbcf47e5c
parentf28f52c6c6b51a257f472c9623a96572338951aa (diff)
downloadacf-tcpproxy-053d0e601f366d04dc78521496eeea2c8e229ba5.tar.bz2
acf-tcpproxy-053d0e601f366d04dc78521496eeea2c8e229ba5.tar.xz
Modified fs.lua to survive nil parameters. Added create_directory and used within create_file and write_file. Reviewed each read_file call to make sure handles nil return value.
git-svn-id: svn://svn.alpinelinux.org/acf/tcpproxy/trunk@1677 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--tcpproxy-model.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/tcpproxy-model.lua b/tcpproxy-model.lua
index d5e8a12..f361799 100644
--- a/tcpproxy-model.lua
+++ b/tcpproxy-model.lua
@@ -173,7 +173,7 @@ local function validatesmtpentry(entry)
end
local function getsmtpcmd(ipaddr)
- config = config or parseconfigfile(fs.read_file(configfile))
+ config = config or parseconfigfile(fs.read_file(configfile) or "")
local smtpconfig = getsmtpconfig(config)
local exec = ""
for i,entry in ipairs(smtpconfig) do
@@ -230,7 +230,7 @@ function listsmtpentries(self)
local reverseaddress = {}
for i,int in ipairs(entries.value) do reverseaddress[int.ipaddr or int.interface] = i end
- config = config or parseconfigfile(fs.read_file(configfile))
+ config = config or parseconfigfile(fs.read_file(configfile) or "")
local smtpconfig = getsmtpconfig(config)
for i,int in ipairs(smtpconfig) do
local pos = reverseaddress[int.ipaddr]