From e5cdb84647b17427ed0f8afc77ab83af6f537ac0 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 21 Jan 2009 22:04:37 +0000 Subject: Added escapespecialcharacters to format.lua to escape shell special characters. Reviewed all calls to io.popen and os.execute to escape special characters. Fixed file uploads in openssl and ipsectools with viewfunctions.lua. Tried to fix openssl renew when subject contains special characters, but not done yet. git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1687 ab2d0c66-481e-0410-8bed-d214d4d58bed --- acf-hooks.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'acf-hooks.lua') diff --git a/acf-hooks.lua b/acf-hooks.lua index 41119bf..bae047e 100644 --- a/acf-hooks.lua +++ b/acf-hooks.lua @@ -15,12 +15,13 @@ -- self, CONFFILE, and TEMPFILE -- Example of a general logging function +require("format") local precommit=function(self, conf, temp) local logfile = "/var/log/acf-" .. self.conf.controller .. ".log" fs.write_line_file (logfile, "#---- BEGIN TRANSACTION - " .. os.date() .. "\n" .. self.sessiondata.userinfo.userid .. " modifed " .. conf .. " as follows:") - os.execute ("diff -u " .. conf .. " " .. temp .. " >>" .. logfile) + os.execute ("diff -u " .. format.escapespecialcharacters(conf) .. " " .. format.escapespecialcharacters(temp) .. " >>" .. format.escapespecialcharacters(logfile)) fs.write_line_file (logfile, "\n#---- END TRANSACTION -") end -- cgit v1.2.3