aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2014-04-30 12:47:59 +0200
committerLukas Nykryn <lnykryn@redhat.com>2014-04-30 12:47:59 +0200
commita466c9e62a02e30284f568f1ec62551a7faaed8d (patch)
tree4ea5facc98d055f46f3faa98c1406b2c509a8ca9 /rc.d/init.d
parent15e9fa1b6de2c5e7b593c47d3f1f9c506bdbe618 (diff)
downloadinitscripts-a466c9e62a02e30284f568f1ec62551a7faaed8d.tar
initscripts-a466c9e62a02e30284f568f1ec62551a7faaed8d.tar.gz
initscripts-a466c9e62a02e30284f568f1ec62551a7faaed8d.tar.bz2
initscripts-a466c9e62a02e30284f568f1ec62551a7faaed8d.tar.xz
initscripts-a466c9e62a02e30284f568f1ec62551a7faaed8d.zip
init.d/functions: check parent dir of pid file for accessibility
Diffstat (limited to 'rc.d/init.d')
-rw-r--r--rc.d/init.d/functions3
1 files changed, 3 insertions, 0 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index 8c4d2573..9f1c76f1 100644
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -110,6 +110,9 @@ checkpid() {
__pids_var_run() {
local base=${1##*/}
local pid_file=${2:-/var/run/$base.pid}
+ local pid_dir=$(/usr/bin/dirname $pid_file > /dev/null)
+
+ [ -d "$pid_dir" -a ! -r "$pid_dir" ] && return 4
pid=
if [ -f "$pid_file" ] ; then