diff --git a/packages/static/kairos-overlay-files/collection.yaml b/packages/static/kairos-overlay-files/collection.yaml index a148c2b6c..76c012e63 100644 --- a/packages/static/kairos-overlay-files/collection.yaml +++ b/packages/static/kairos-overlay-files/collection.yaml @@ -1,4 +1,4 @@ packages: - name: "kairos-overlay-files" category: "static" - version: "1.1.45" + version: "1.1.46" diff --git a/packages/static/kairos-overlay-files/files/system/oem/00_home_dir_owner_fix.yaml b/packages/static/kairos-overlay-files/files/system/oem/00_home_dir_owner_fix.yaml new file mode 100644 index 000000000..b8cc4cb3d --- /dev/null +++ b/packages/static/kairos-overlay-files/files/system/oem/00_home_dir_owner_fix.yaml @@ -0,0 +1,15 @@ +name: "Fix home directory permissions (kairos issue #2797)" +stages: + initramfs.after: + - name: "Fix permissions" + commands: + - | + # Iterate over users in /etc/passwd and chown their directories + awk -F: '$3 >= 1000 && $6 ~ /^\/home\// {print $1, $6}' /etc/passwd | while read -r user homedir; do + if [ -d "$homedir" ]; then # Check if the home directory exists + echo "Changing ownership of $homedir to $user" + chown -R "$user":"$user" "$homedir" + else + echo "Directory $homedir does not exist for user $user" + fi + done