Files
runner-images/images/linux/post-generation/rust-permissions.sh
Leonid Lapshin 3c77354cd5 [ubuntu] fix user on rust and brew scripts (#1907)
* 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>
2020-10-28 17:58:15 +03:00

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