Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix configure_bashrc_exec_tmux missing parenthesis #11448

Conversation

BenoitGui
Copy link
Contributor

@BenoitGui BenoitGui commented Jan 16, 2024

Description:

Fix missing parentheses in configure_bashrc_exec_tmux

Rationale:

@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Jan 16, 2024
Copy link

openshift-ci bot commented Jan 16, 2024

Hi @BenoitGui. Thanks for your PR.

I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

Start a new ephemeral environment with changes proposed in this pull request:

rhel8 (from CTF) Environment (using Fedora as testing environment)
Open in Gitpod

Fedora Testing Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

Copy link

This datastream diff is auto generated by the check Compare DS/Generate Diff

Click here to see the full diff
bash remediation for rule 'xccdf_org.ssgproject.content_rule_configure_bashrc_exec_tmux' differs.
--- xccdf_org.ssgproject.content_rule_configure_bashrc_exec_tmux
+++ xccdf_org.ssgproject.content_rule_configure_bashrc_exec_tmux
@@ -1,12 +1,12 @@
 # Remediation is applicable only in certain platforms
 if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ] && { rpm --quiet -q tmux; }; then
 
-if ! grep -x '  case "$name" in sshd|login) exec tmux ;; esac' /etc/bashrc; then
+if ! grep -x '  case "$name" in (sshd|login) exec tmux ;; esac' /etc/bashrc; then
     cat >> /etc/profile.d/tmux.sh <<'EOF'
 if [ "$PS1" ]; then
   parent=$(ps -o ppid= -p $$)
   name=$(ps -o comm= -p $parent)
-  case "$name" in sshd|login) exec tmux ;; esac
+  case "$name" in (sshd|login) exec tmux ;; esac
 fi
 EOF
     chmod 0644 /etc/profile.d/tmux.sh

@BenoitGui BenoitGui force-pushed the fix_configure_bashrc_exec_tmux branch from 9f37e6e to 023fabe Compare January 16, 2024 15:20
@BenoitGui BenoitGui changed the title Fix configure_bashrc_exec_tmux missing parentheses Fix configure_bashrc_exec_tmux missing parenthesis Jan 16, 2024
@ggbecker
Copy link
Member

/packit retest-failed

Copy link

codeclimate bot commented Jan 17, 2024

Code Climate has analyzed commit 023fabe and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 58.5% (0.0% change).

View more on Code Climate.

@vojtapolasek vojtapolasek self-assigned this Jan 19, 2024
@vojtapolasek
Copy link
Collaborator

/packit retest-failed

@openshift-merge-robot openshift-merge-robot added the needs-rebase Used by openshift-ci bot. label Jan 28, 2024
@openshift-merge-robot
Copy link
Collaborator

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@vojtapolasek
Copy link
Collaborator

I tested Automatus tests locally and they pass. Merging.

Copy link
Collaborator

@vojtapolasek vojtapolasek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vojtapolasek vojtapolasek merged commit 90d9978 into ComplianceAsCode:master Feb 9, 2024
33 of 37 checks passed
@Mab879 Mab879 added the Bash Bash remediation update. label May 16, 2024
@Mab879 Mab879 modified the milestones: 0.1.72, 0.1.73 May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bash Bash remediation update. needs-ok-to-test Used by openshift-ci bot. needs-rebase Used by openshift-ci bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants