Rust: Update permissions for home folders

This commit is contained in:
Samruddhi Khandale 2023-11-14 14:18:48 -08:00 committed by GitHub
parent d53b9d1816
commit eb0d87162e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{
"id": "rust",
"version": "1.1.1",
"version": "1.2.0",
"name": "Rust",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/rust",
"description": "Installs Rust, common Rust utilities, and their required dependencies",

View file

@ -159,8 +159,6 @@ if ! cat /etc/group | grep -e "^rustlang:" > /dev/null 2>&1; then
fi
usermod -a -G rustlang "${USERNAME}"
mkdir -p "${CARGO_HOME}" "${RUSTUP_HOME}"
chown "${USERNAME}:rustlang" "${RUSTUP_HOME}" "${CARGO_HOME}"
chmod g+r+w+s "${RUSTUP_HOME}" "${CARGO_HOME}"
if [ "${RUST_VERSION}" = "none" ] || type rustup > /dev/null 2>&1; then
echo "Rust already installed. Skipping..."
@ -210,7 +208,10 @@ EOF
)"
# Make files writable for rustlang group
chown -R "${USERNAME}:rustlang" "${RUSTUP_HOME}" "${CARGO_HOME}"
chmod -R g+r+w "${RUSTUP_HOME}" "${CARGO_HOME}"
find "${RUSTUP_HOME}" -type d -print0 | xargs -n 1 -0 chmod g+s
find "${CARGO_HOME}" -type d -print0 | xargs -n 1 -0 chmod g+s
# Clean up
rm -rf /var/lib/apt/lists/*