commit:     36e288262d4a9993fe3528ca913f174cdd4de0f3
Author:     Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 10 18:30:19 2022 +0000
Commit:     Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
CommitDate: Sat Dec 10 18:31:35 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=36e28826

app-backup/bareos: improve openrc init scripts

Signed-off-by: Marc Schiffbauer <mschiff <AT> gentoo.org>

 app-backup/bareos/files/bareos-dir.initd | 4 ++++
 app-backup/bareos/files/bareos-sd.initd  | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/app-backup/bareos/files/bareos-dir.initd 
b/app-backup/bareos/files/bareos-dir.initd
index 0bb566582f4c..a2986d133cc3 100644
--- a/app-backup/bareos/files/bareos-dir.initd
+++ b/app-backup/bareos/files/bareos-dir.initd
@@ -8,6 +8,10 @@ depend() {
 
 start_pre() {
        checkpath --directory --owner root:bareos --mode 01775 /run/bareos
+       if [[ -e /run/bareos/bareos-dir.9101.pid && $(stat -c %U 
/run/bareos/bareos-dir.9101.pid) != "root" ]]; then
+               eerror "SECURITY ALERT: bareos owned pidfile found! (see 
#631598)"
+               exit 1
+       fi
 }
 
 start_post() {

diff --git a/app-backup/bareos/files/bareos-sd.initd 
b/app-backup/bareos/files/bareos-sd.initd
index 222dc95f47d5..a4a45343d137 100644
--- a/app-backup/bareos/files/bareos-sd.initd
+++ b/app-backup/bareos/files/bareos-sd.initd
@@ -8,6 +8,10 @@ depend() {
 
 start_pre() {
        checkpath --directory --owner root:bareos --mode 01775 /run/bareos
+       if [[ -e /run/bareos/bareos-sd.9103.pid && $(stat -c %U 
/run/bareos/bareos-sd.9103.pid) != "root" ]]; then
+               eerror "SECURITY ALERT: bareos owned pidfile found! (see 
#631598)"
+               exit 1
+       fi
 }
 
 start_post() {

Reply via email to