Skip to content

Commit

Permalink
Merge pull request #13027 from alanmcanonical/fix_accounts_user_dot_g…
Browse files Browse the repository at this point in the history
…roup_ownership

[Ubuntu2404] Fix remediation of rule accounts_user_dot_group_ownership
  • Loading branch information
dodys authored Feb 14, 2025
2 parents 752795a + 99d2959 commit a22ce4a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
# disruption = low

- name: Ensure interactive local users are the group-owners of their respective initialization files
ansible.builtin.command:
ansible.builtin.shell:
cmd: |
awk -F':' '{ if ($3 >= {{{ uid_min }}} && $3 != {{{ nobody_uid }}}) system("chgrp -f " $4" "$6"/.[^\.]?*") }' /etc/passwd
awk -F: '{if ($4 >= {{{ gid_min }}} && $4 != {{{ nobody_gid }}}) print $4":"$6}' /etc/passwd | while IFS=: read -r gid home; do find "$home" -maxdepth 1 -name "\.[^.]*" -exec chgrp -f $gid "{}" \;; done
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# complexity = low
# disruption = low

awk -F':' '{ if ($3 >= {{{ uid_min }}} && $3 != {{{ nobody_uid }}}) system("chgrp -f " $4" "$6"/.[^\.]?*") }' /etc/passwd
awk -F: '{if ($4 >= {{{ gid_min }}} && $4 != {{{ nobody_gid }}}) print $4":"$6}' /etc/passwd | while IFS=: read -r gid home; do find "$home" -maxdepth 1 -name "\.[^.]*" -exec chgrp -f $gid "{}" \;; done

0 comments on commit a22ce4a

Please sign in to comment.