Skip to content

Commit 1e1596c

Browse files
authored
Merge pull request #33 from menny/permissions-fix
Folders that required to be RO will be copied
2 parents 56d7b87 + 2a96970 commit 1e1596c

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

.github/versions.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
IMAGE_VERSION=1.21.7
1+
IMAGE_VERSION=1.21.8
22
NDK_VERSION=27.2.12479018
33
BAZELISK_VERSION=v1.26.0

android_dev/entrypoint.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,24 @@ echo "cd $CLONE_DIR" >> "/home/${ACTUAL_USER}/.zshrc"
2828
# --- 2. Set Permissions ---
2929

3030
# Function to fix ownership and permissions for a directory
31-
fix_dir_permissions() {
31+
copy_fix_dir_permissions() {
3232
local dir_path=$1
3333
echo "Fixing permissions for ${dir_path}..."
34+
mkdir -p "${dir_path}"
35+
local original_path="${dir_path}_original"
36+
cp -a "${original_path}/." "${dir_path}/"
3437
chown -R ${ACTUAL_USER}:${ACTUAL_USER} "${dir_path}"
3538
find "${dir_path}" -type d -exec chmod 700 {} +
3639
find "${dir_path}" -type f -exec chmod 600 {} +
3740
}
3841

3942
# Function to fix ownership for a file
40-
fix_file_owner() {
43+
copy_fix_file_owner() {
4144
local file_path=$1
4245
echo "Fixing ownership for ${file_path}..."
46+
mkdir -p "dirname(${file_path})"
47+
local original_path="${file_path}_original"
48+
cp "${original_path}" "${file_path}"
4349
chown ${ACTUAL_USER}:${ACTUAL_USER} "${file_path}"
4450
}
4551

@@ -48,11 +54,10 @@ echo "Setting permissions for user '${ACTUAL_USER}' on '${CLONE_DIR}'..."
4854
chown -R ${ACTUAL_USER}:${ACTUAL_USER} "${CLONE_DIR}"
4955

5056
# Fix permissions for mounted directories and files
51-
fix_dir_permissions "/home/${ACTUAL_USER}/.ssh"
52-
fix_dir_permissions "/home/${ACTUAL_USER}/.gnupg"
53-
fix_dir_permissions "/home/${ACTUAL_USER}/.gemini"
54-
fix_dir_permissions "/home/${ACTUAL_USER}/shared_srv"
55-
fix_file_owner "/home/${ACTUAL_USER}/.gitconfig"
57+
copy_fix_dir_permissions "/home/${ACTUAL_USER}/.ssh"
58+
copy_fix_dir_permissions "/home/${ACTUAL_USER}/.gnupg"
59+
copy_fix_dir_permissions "/home/${ACTUAL_USER}/.gemini"
60+
copy_fix_file_owner "/home/${ACTUAL_USER}/.gitconfig"
5661

5762
# --- 3. Set User Password ---
5863
# Check if the ACTUAL_PASSWORD environment variable is provided

0 commit comments

Comments
 (0)