From ea5788380b408894e8a7b0d165bf535d1a3fbe51 Mon Sep 17 00:00:00 2001 From: Stephen Baynham Date: Thu, 10 Oct 2019 06:27:43 -0700 Subject: Add quotes around usernames to handle usernames with space on Windows --- src/luarocks/fs/win32/tools.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/luarocks/fs/win32/tools.lua b/src/luarocks/fs/win32/tools.lua index f9468517..57e8c80e 100644 --- a/src/luarocks/fs/win32/tools.lua +++ b/src/luarocks/fs/win32/tools.lua @@ -239,7 +239,7 @@ function tools.set_permissions(filename, mode, scope) return false, "Could not take ownership of the given file" end -- Grant the current user the proper rights - ok = fs.execute_quiet(vars.ICACLS .. " " .. fs.Q(filename) .. " /inheritance:d /grant:r %USERNAME%:" .. perms) + ok = fs.execute_quiet(vars.ICACLS .. " " .. fs.Q(filename) .. " /inheritance:d /grant:r \"%USERNAME%\":" .. perms) if not ok then return false, "Failed setting permission " .. mode .. " for " .. scope end @@ -267,7 +267,7 @@ function tools.set_permissions(filename, mode, scope) return false, "Failed setting permission " .. mode .. " for " .. scope end -- Grant permissions available only to the current user - ok = fs.execute_quiet(vars.ICACLS .. " " .. fs.Q(filename) .. " /inheritance:d /grant %USERNAME%:" .. my_perms) + ok = fs.execute_quiet(vars.ICACLS .. " " .. fs.Q(filename) .. " /inheritance:d /grant \"%USERNAME%\":" .. my_perms) if not ok then return false, "Failed setting permission " .. mode .. " for " .. scope end -- cgit v1.2.3-55-g6feb