summaryrefslogtreecommitdiff
path: root/app-backup/bareos/files/bareos-sd.initd
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-09-10 04:21:55 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-09-10 04:21:55 +0100
commit677b7ba5c317778df2ad7e70df94b9b7eec4adbc (patch)
tree6c418a1546fff5becab5d8b9ed6803323e7f316e /app-backup/bareos/files/bareos-sd.initd
parentfbda87924e6faa7a1919f1a2b4182490bde5ec5c (diff)
gentoo resync : 10.09.2021
Diffstat (limited to 'app-backup/bareos/files/bareos-sd.initd')
-rw-r--r--app-backup/bareos/files/bareos-sd.initd15
1 files changed, 12 insertions, 3 deletions
diff --git a/app-backup/bareos/files/bareos-sd.initd b/app-backup/bareos/files/bareos-sd.initd
index 4f7fbcb52bf2..97b9ccdc92f1 100644
--- a/app-backup/bareos/files/bareos-sd.initd
+++ b/app-backup/bareos/files/bareos-sd.initd
@@ -1,5 +1,5 @@
#!/sbin/openrc-run
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
depend() {
@@ -8,14 +8,23 @@ depend() {
start() {
ebegin "Starting bareos storage daemon"
- checkpath -d -m 0750 -o root:bareos /run/bareos
+ # g+w until #631598 is resolved
+ checkpath -d -m 0770 -o root:bareos /run/bareos
start-stop-daemon --start --quiet --exec /usr/sbin/bareos-sd \
-- ${SD_OPTIONS}
+ # harden pid file until #631598 is resolved
+ ewaitfile 10 /run/bareos/bareos-sd.9103.pid
+ chown root:bareos /run/bareos/bareos-sd.9103.pid
eend $?
}
stop() {
ebegin "Stopping bareos storage daemon"
- start-stop-daemon --stop --quiet --pidfile /run/bareos/bareos-sd.*.pid
+ # check pid file until #631598 is resolved
+ if [[ $(stat -c %U /run/bareos/bareos-sd.9103.pid) != "root" ]]; then
+ eerror "SECURITY ALERT: pid file is not root owned anymore?! (see #631598)"
+ else
+ start-stop-daemon --stop --quiet --pidfile /run/bareos/bareos-sd.9103.pid
+ fi
eend $?
}