summaryrefslogtreecommitdiffstats
path: root/openssl-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-10-07 17:31:24 +0000
committerTed Trask <ttrask01@yahoo.com>2008-10-07 17:31:24 +0000
commit673003b8c58fbfe9c6159ea29a175af1faf75076 (patch)
tree5dbbe74512c4a9863f44f9e2c0a94bee5c0e3de4 /openssl-model.lua
parent04e1f8df658739e546dbcb29f3d0517b27fea042 (diff)
downloadacf-openssl-673003b8c58fbfe9c6159ea29a175af1faf75076.tar.bz2
acf-openssl-673003b8c58fbfe9c6159ea29a175af1faf75076.tar.xz
Modified modelfunctions library to include validation in get/setfiledetails. Modified all uses to validate the file name - this was a major security hole.
git-svn-id: svn://svn.alpinelinux.org/acf/openssl/trunk@1542 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'openssl-model.lua')
-rw-r--r--openssl-model.lua15
1 files changed, 1 insertions, 14 deletions
diff --git a/openssl-model.lua b/openssl-model.lua
index 2a02129..07ab963 100644
--- a/openssl-model.lua
+++ b/openssl-model.lua
@@ -783,21 +783,8 @@ getconfigfile = function()
end
setconfigfile = function(filedetails)
- filedetails.value.filename.value = configfile
- filedetails.value.filecontent.value = string.gsub(format.dostounix(filedetails.value.filecontent.value), "\n+$", "")
-
-- validate
- local success = true
-
- if success then
- fs.write_file(configfile, filedetails.value.filecontent.value)
- filedetails = getconfigfile()
- config = nil
- else
- filedetails.errtxt = "Failed to set configuration file"
- end
-
- return filedetails
+ return modelfunctions.setfiledetails(filedetails, {configfile})
end
checkenvironment = function(set)