autofs: Add more strict umask to users

This commit is contained in:
Timo Makinen 2025-06-09 16:18:15 +00:00
parent 1b3a2a8000
commit 40e834144f
3 changed files with 19 additions and 0 deletions

3
roles/autofs/files/umask.csh Executable file
View file

@ -0,0 +1,3 @@
if ($uid > 999 && "`/usr/bin/id -gn`" == "`/usr/bin/id -un`") then
umask 007
endif

5
roles/autofs/files/umask.sh Executable file
View file

@ -0,0 +1,5 @@
# shellcheck shell=sh
if [ "$(id -u)" -gt 999 ] && [ "$(id -gn)" = "$(id -un)" ]; then
umask 007
fi

View file

@ -80,3 +80,14 @@
with_items: with_items:
- usercache.sh - usercache.sh
- usercache.csh - usercache.csh
- name: Set umask for users
ansible.builtin.copy:
dest: "/etc/profile.d/{{ item }}"
src: "{{ item }}"
mode: "0644"
owner: root
group: "{{ ansible_wheel }}"
with_items:
- umask.sh
- umask.csh