diff options
author | Stephen Baynham <sdbaynham@gmail.com> | 2019-10-10 06:27:43 -0700 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2019-12-02 14:16:33 -0300 |
commit | ea5788380b408894e8a7b0d165bf535d1a3fbe51 (patch) | |
tree | 167979a9528911a593bc89cabcbc141a67eca531 /src | |
parent | 27c09f27b22b26463e7e6b47431d539c7e496c6e (diff) | |
download | luarocks-ea5788380b408894e8a7b0d165bf535d1a3fbe51.tar.gz luarocks-ea5788380b408894e8a7b0d165bf535d1a3fbe51.tar.bz2 luarocks-ea5788380b408894e8a7b0d165bf535d1a3fbe51.zip |
Add quotes around usernames to handle usernames with space on Windows
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/fs/win32/tools.lua | 4 |
1 files changed, 2 insertions, 2 deletions
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) | |||
239 | return false, "Could not take ownership of the given file" | 239 | return false, "Could not take ownership of the given file" |
240 | end | 240 | end |
241 | -- Grant the current user the proper rights | 241 | -- Grant the current user the proper rights |
242 | ok = fs.execute_quiet(vars.ICACLS .. " " .. fs.Q(filename) .. " /inheritance:d /grant:r %USERNAME%:" .. perms) | 242 | ok = fs.execute_quiet(vars.ICACLS .. " " .. fs.Q(filename) .. " /inheritance:d /grant:r \"%USERNAME%\":" .. perms) |
243 | if not ok then | 243 | if not ok then |
244 | return false, "Failed setting permission " .. mode .. " for " .. scope | 244 | return false, "Failed setting permission " .. mode .. " for " .. scope |
245 | end | 245 | end |
@@ -267,7 +267,7 @@ function tools.set_permissions(filename, mode, scope) | |||
267 | return false, "Failed setting permission " .. mode .. " for " .. scope | 267 | return false, "Failed setting permission " .. mode .. " for " .. scope |
268 | end | 268 | end |
269 | -- Grant permissions available only to the current user | 269 | -- Grant permissions available only to the current user |
270 | ok = fs.execute_quiet(vars.ICACLS .. " " .. fs.Q(filename) .. " /inheritance:d /grant %USERNAME%:" .. my_perms) | 270 | ok = fs.execute_quiet(vars.ICACLS .. " " .. fs.Q(filename) .. " /inheritance:d /grant \"%USERNAME%\":" .. my_perms) |
271 | if not ok then | 271 | if not ok then |
272 | return false, "Failed setting permission " .. mode .. " for " .. scope | 272 | return false, "Failed setting permission " .. mode .. " for " .. scope |
273 | end | 273 | end |