autofs: Add more strict umask to users
This commit is contained in:
parent
1b3a2a8000
commit
40e834144f
3 changed files with 19 additions and 0 deletions
3
roles/autofs/files/umask.csh
Executable file
3
roles/autofs/files/umask.csh
Executable 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
5
roles/autofs/files/umask.sh
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
# shellcheck shell=sh
|
||||||
|
if [ "$(id -u)" -gt 999 ] && [ "$(id -gn)" = "$(id -un)" ]; then
|
||||||
|
umask 007
|
||||||
|
fi
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue