Skip to content

Commit

Permalink
Merge pull request #12533 from a-skr/bugfix/12409
Browse files Browse the repository at this point in the history
Fix file path inconsistencies in accounts_umask_etc_bashrc
  • Loading branch information
Mab879 authored Oct 24, 2024
2 parents 12604c7 + 1ff558c commit 04a7fa4
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Dockerfiles/test_suite-debian12
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ARG ADDITIONAL_PACKAGES
RUN true \
&& apt update \
&& apt install -y openssh-server python3 openscap-scanner \
$ADDITIONAL_PACKAGES \
python3-apt $ADDITIONAL_PACKAGES \
&& true

RUN true \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/test_suite-ubuntu2204
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN true \
&& apt update \
&& apt install -y cmake g++ libacl1-dev libblkid-dev libbz2-dev libcap-dev libcurl4-openssl-dev libdbus-1-dev libdbus-glib-1-dev \
libgconf2-dev libgcrypt20-dev libldap2-dev libpcre2-dev libperl-dev librpm-dev libselinux1-dev libxml2-dev libxml-parser-perl \
libxmlsec1-dev libxmlsec1-openssl libxml-xpath-perl libxslt1-dev libyaml-dev openssh-server python3-dev swig wget \
libxmlsec1-dev libxmlsec1-openssl libxml-xpath-perl libxslt1-dev libyaml-dev openssh-server python3-dev python3-apt swig wget \
$ADDITIONAL_PACKAGES \
&& true

Expand Down
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 04a7fa4

Please sign in to comment.