aboutsummaryrefslogtreecommitdiff
path: root/src/rust
diff options
context:
space:
mode:
authorSamruddhi Khandale <samruddhikhandale@github.com>2023-11-15 01:18:48 +0300
committerGitHub <noreply@github.com>2023-11-15 01:18:48 +0300
commiteb0d87162ee4446ec333d76058c17cb1040aa44e (patch)
tree6cf41e6c61b08068efbb47e01bddca0cc8b20598 /src/rust
parentd53b9d1816bac7a62f9ba5f20723eef428042d1f (diff)
Rust: Update permissions for home folderssamruddhikhandale/rust-permissions
Diffstat (limited to 'src/rust')
-rw-r--r--src/rust/devcontainer-feature.json2
-rwxr-xr-xsrc/rust/install.sh5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/rust/devcontainer-feature.json b/src/rust/devcontainer-feature.json
index 7ee455f..630b76f 100644
--- a/src/rust/devcontainer-feature.json
+++ b/src/rust/devcontainer-feature.json
@@ -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",
diff --git a/src/rust/install.sh b/src/rust/install.sh
index 00c0a6e..a7e4411 100755
--- a/src/rust/install.sh
+++ b/src/rust/install.sh
@@ -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/*