aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-08-14 12:44:40 +1000
committerHisham Muhammad <hisham@gobolinux.org>2018-08-14 13:25:51 -0300
commit4eb27bea022c1bcd816561d2e8e64d67aef62b18 (patch)
treef61ae1a9a528bdffca91c3e761b4a302d29c51d7
parent97612b69ef22d7e595b485c2f7dd003fa7da6da2 (diff)
downloadluarocks-4eb27bea022c1bcd816561d2e8e64d67aef62b18.tar.gz
luarocks-4eb27bea022c1bcd816561d2e8e64d67aef62b18.tar.bz2
luarocks-4eb27bea022c1bcd816561d2e8e64d67aef62b18.zip
fs/unix/tools: Throw error if umask output is invalid
-rw-r--r--src/luarocks/fs/unix/tools.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/luarocks/fs/unix/tools.lua b/src/luarocks/fs/unix/tools.lua
index 31d8f0ca..f99582bd 100644
--- a/src/luarocks/fs/unix/tools.lua
+++ b/src/luarocks/fs/unix/tools.lua
@@ -214,6 +214,9 @@ do
214 local umask = assert(fd:read("*a")) 214 local umask = assert(fd:read("*a"))
215 fd:close() 215 fd:close()
216 local u, g, o = umask:match("u=([rwx]*),g=([rwx]*),o=([rwx]*)") 216 local u, g, o = umask:match("u=([rwx]*),g=([rwx]*),o=([rwx]*)")
217 if not u then
218 error("invalid umask result")
219 end
217 umask_cache = string.format("%d%d%d", 220 umask_cache = string.format("%d%d%d",
218 7 - rwx_to_octal(u), 221 7 - rwx_to_octal(u),
219 7 - rwx_to_octal(g), 222 7 - rwx_to_octal(g),