From 701c0b1e32f4a7e1b38a9809cf814a337e5dfdb1 Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Tue, 4 Apr 2017 10:51:11 -0500 Subject: [PATCH] Fix path to daemon init params file Ubuntu 14.04 and CentOS 7 have their daemon inititalization parameters file in different places. This fixes a bug where the path in CentOS was incorrect. Closes-Bug: 1662545 Change-Id: Ie0b30848a73f8a1fbc7fe6a475d93d87a72ce40f --- tasks/rhel6stig/file_perms.yml | 4 ++-- vars/redhat.yml | 1 + vars/ubuntu.yml | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tasks/rhel6stig/file_perms.yml b/tasks/rhel6stig/file_perms.yml index 4ed549fd..23b634a0 100644 --- a/tasks/rhel6stig/file_perms.yml +++ b/tasks/rhel6stig/file_perms.yml @@ -125,10 +125,10 @@ # Please read the documentation and the comments in defaults/main.yml prior # to making any umask-related changes. -# Ubuntu 14.04's default umask in /etc/init.d/rc is 022 already. +# Ubuntu 14.04 and CentOS 7 both have a default umask set to 022 already. - name: V-38642 - System default umask for daemons must be 027 or 022 lineinfile: - dest: /etc/init.d/rc + dest: "{{ daemon_init_params_file }}" regexp: "^umask " line: "umask {{ security_umask_daemons_init }}" when: security_umask_daemons_init is defined diff --git a/vars/redhat.yml b/vars/redhat.yml index b5d1941d..b48141d1 100644 --- a/vars/redhat.yml +++ b/vars/redhat.yml @@ -30,6 +30,7 @@ grub_defaults_file: /etc/sysconfig/grub aide_cron_job_path: /etc/cron.d/aide aide_database_file: /var/lib/aide/aide.db.gz chrony_conf_file: /etc/chrony.conf +daemon_init_params_file: /etc/init.d/functions # Service names cron_service: crond diff --git a/vars/ubuntu.yml b/vars/ubuntu.yml index 9d5f2818..f56ac3da 100644 --- a/vars/ubuntu.yml +++ b/vars/ubuntu.yml @@ -33,6 +33,7 @@ grub_defaults_file: /etc/default/grub aide_cron_job_path: /etc/cron.daily/aide aide_database_file: /var/lib/aide/aide.db chrony_conf_file: /etc/chrony/chrony.conf +daemon_init_params_file: /etc/init.d/rc # Service name cron_service: cron