Skip to content

Commit ba0e7ce

Browse files
committed
Correction in the CONDA directory permission
1 parent 48ef5f6 commit ba0e7ce

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/anaconda/install.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,15 @@ if ! conda --version &> /dev/null ; then
257257
chown -R "${USERNAME}:conda" "${CONDA_DIR}"
258258
chmod -R g+r+w "${CONDA_DIR}"
259259

260-
# Only set permissions if CONDA_DIR exists and is a directory
261-
if [ -d "${CONDA_DIR}" ]; then
262-
chmod g+s "${CONDA_DIR}"
263-
set_directory_permissions "${CONDA_DIR}"
260+
# Set setgid bit on all directories - use find+xargs if available, fallback to recursive function
261+
if command -v find > /dev/null && command -v xargs > /dev/null; then
262+
find "${CONDA_DIR}" -type d -print0 | xargs -n 1 -0 chmod g+s
263+
else
264+
# Fallback for systems without find or xargs
265+
if [ -d "${CONDA_DIR}" ]; then
266+
chmod g+s "${CONDA_DIR}"
267+
set_directory_permissions "${CONDA_DIR}"
268+
fi
264269
fi
265270

266271
# Temporary fixes

0 commit comments

Comments
 (0)