diff options
author | Steven Barth <steven@midlink.org> | 2008-03-29 18:22:21 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-03-29 18:22:21 +0000 |
commit | 1c6c6d62ca665f9d1126b6bad849f7fd584b6a80 (patch) | |
tree | d0f6d975a17d100a52d158a72904d3cbbf964ab4 /src/ffluci/util.lua | |
parent | cdb0b2f0bfaa0e0bb40b1b90581e1376f55fb0df (diff) |
* Replaced luafilesystem with luaposix library
* Introduced privilege dropping capability
* Automatically drop privileges for "public" to "nobody/nogroup" (as defined in ffluci.uci)
Diffstat (limited to 'src/ffluci/util.lua')
-rw-r--r-- | src/ffluci/util.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ffluci/util.lua b/src/ffluci/util.lua index 85092f065..c47a89895 100644 --- a/src/ffluci/util.lua +++ b/src/ffluci/util.lua @@ -150,6 +150,16 @@ function instanceof(object, class) end +-- Creates valid XML PCDATA from a string +function pcdata(value) + value = value:gsub("&", "&") + value = value:gsub('"', """) + value = value:gsub("'", "'") + value = value:gsub("<", "<") + return value:gsub(">", ">") +end + + -- Resets the scope of f doing a shallow copy of its scope into a new table function resfenv(f) setfenv(f, clone(getfenv(f))) |