mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 13:17:54 +00:00
* fix user on rust and brew scripts * set user on a factory stage * get last user from /etc/passwd Co-authored-by: Leonid Lapshin <originalnoe-nazvanie@yandex.ru>
15 lines
400 B
Bash
15 lines
400 B
Bash
#!/bin/bash
|
|
|
|
# Fix permissions for the Rust folder
|
|
# https://github.com/actions/virtual-environments/issues/572
|
|
|
|
rust_folder="/usr/share/rust"
|
|
rust_user=$(cut -d: -f1 /etc/passwd | tail -1)
|
|
|
|
if [ -d "$rust_folder" ]; then
|
|
rust_folder_owner=$(ls -ld $rust_folder | awk '{print $3}')
|
|
if [ "$rust_user" != "$rust_folder_owner" ]; then
|
|
chown "$rust_user":docker -R $rust_folder
|
|
fi
|
|
fi
|