Skip to content

Commit

Permalink
Fix file path inconsistencies in accounts_umask_etc_bashrc
Browse files Browse the repository at this point in the history
fixes #12409
  • Loading branch information
a-skr committed Oct 24, 2024
1 parent b18b216 commit 557c219
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# disruption = low
{{{ ansible_instantiate_variables("var_accounts_user_umask") }}}

{{% if 'sle' in product or 'ubuntu' in product %}}
{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}}
{{% set etc_bash_rc = "/etc/bash.bashrc" %}}
{{% else %}}
{{% set etc_bash_rc = "/etc/bashrc" %}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{{{ bash_instantiate_variables("var_accounts_user_umask") }}}

{{% if 'sle' in product or 'ubuntu' in product %}}
{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}}
{{% set etc_bash_rc = "/etc/bash.bashrc" %}}
{{% else %}}
{{% set etc_bash_rc = "/etc/bashrc" %}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{% if 'sle' in product or 'ubuntu' in product %}}
{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}}
{{% set etc_bash_rc = "/etc/bash.bashrc" %}}
{{% else %}}
{{% set etc_bash_rc = "/etc/bashrc" %}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ documentation_complete: true

title: 'Ensure the Default Bash Umask is Set Correctly'

{{% if 'sle' in product %}}
{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}}
{{% set etc_bash_rc = "/etc/bash.bashrc" %}}
{{% else %}}
{{% set etc_bash_rc = "/etc/bashrc" %}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# packages = bash

{{% if 'sle' in product or 'ubuntu' in product %}}
{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}}
etc_bash_rc="/etc/bash.bashrc"
{{% else %}}
etc_bash_rc="/etc/bashrc"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# profiles = xccdf_org.ssgproject.content_profile_cis, xccdf_org.ssgproject.content_profile_ospp
# packages = bash

{{% if 'sle' in product or 'ubuntu' in product %}}
{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}}
etc_bash_rc="/etc/bash.bashrc"
{{% else %}}
etc_bash_rc="/etc/bashrc"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# packages = bash

{{% if 'sle' in product or 'ubuntu' in product %}}
{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}}
etc_bash_rc="/etc/bash.bashrc"
{{% else %}}
etc_bash_rc="/etc/bashrc"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/bin/bash
# packages = bash

sed -i '/umask/d' /etc/bashrc
echo "umask 000" >> /etc/bashrc
{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}}
etc_bash_rc="/etc/bash.bashrc"
{{% else %}}
etc_bash_rc="/etc/bashrc"
{{% endif %}}


sed -i '/umask/d' $etc_bash_rc
echo "umask 000" >> $etc_bash_rc
umask 000
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

# This TS is a regression test for https://github.com/ComplianceAsCode/content/issues/11937

{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}}
etc_bash_rc="/etc/bash.bashrc"
{{% else %}}
etc_bash_rc="/etc/bashrc"
{{% endif %}}

sed -i '/umask/d' /etc/bashrc
echo " [ \`umask\` -eq 0 ] && umask 027022" >> /etc/bashrc
echo " [ \`umask\` -eq 0 ] && umask 027022" >> $etc_bash_rc
umask 000
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/bin/bash
# packages = bash

sed -i '/umask/d' /etc/bashrc
echo " [ \`umask\` -eq 0 ] && umask 022" >> /etc/bashrc
{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}}
etc_bash_rc="/etc/bash.bashrc"
{{% else %}}
etc_bash_rc="/etc/bashrc"
{{% endif %}}


sed -i '/umask/d' $etc_bash_rc
echo " [ \`umask\` -eq 0 ] && umask 022" >> $etc_bash_rc
umask 000
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#!/bin/bash
# packages = bash

sed -i '/umask/d' /etc/bashrc
echo "umask 000" >> /etc/bashrc
echo "umask 000" >> /etc/bashrc
echo "umask 000" >> /etc/bashrc
{{% if 'sle' in product or 'ubuntu' in product or 'debian' in product %}}
etc_bash_rc="/etc/bash.bashrc"
{{% else %}}
etc_bash_rc="/etc/bashrc"
{{% endif %}}


sed -i '/umask/d' $etc_bash_rc
echo "umask 000" >> $etc_bash_rc
echo "umask 000" >> $etc_bash_rc
echo "umask 000" >> $etc_bash_rc
umask 000

0 comments on commit 557c219

Please sign in to comment.