Commit b47c5dc
committed
Windows: Avoid permission issues when building envs. as non-privileged user
Previously, we built environments with the following command:
```
rcc task script -- rcc -v
------
essentially a no-op
```
For unprivileged users, this can fail with:
```
Error: Access is denied.
[rcc] exit status will be: 7!
```
Before executing the command line handed over to `rcc task script`, RCC checks
internally if the first value of the command line exists and tries to resolve it
if it is a symlink:
https://github.com/robocorp/rcc/blob/db661af9d28a61a2dbc3656260de6c29dbe01bcd/operations/running.go#L276
This symlink resolution step (`filepath.EvalSymlinks`) apparently fails on
Windows systems if the user has insufficient permissions to access the parent
folders of the RCC binary, even if the binary is not even a symlink. Note that
the unprivileged user has read and execute access to the RCC binary, otherwise,
starting RCC in the first place would fail.
To solve this issue, we resort to a different no-op in the build step:
* Windows: `cmd.exe`
Note that it is unclear what commands are actually available here. For
example, the echo command is available on Windows systems but cannot be found
when used with `rcc task script`. However, inside a shell created with`rcc
task shell`, the echo command works (and so does calling the RCC binary).
* Linux: `true`
Unfortunately, we have no good way of testing if running plans with an
unprivileged user works, since we cannot create an additional user session in
the GitHub actions.
CMK-200711 parent ff6f241 commit b47c5dc
1 file changed
+12
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
108 | 107 | | |
109 | 108 | | |
110 | 109 | | |
| |||
185 | 184 | | |
186 | 185 | | |
187 | 186 | | |
188 | | - | |
189 | | - | |
190 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
191 | 193 | | |
192 | 194 | | |
193 | 195 | | |
| |||
0 commit comments