File support-p-flag-in-sysconfig.patch of Package fcgiwrap
From f59ce482cbffb46e60a5a0f4d7044d19739d7867 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Wed, 6 Feb 2019 22:11:09 +0100
Subject: [PATCH] support -p flag in sysconfig
---
systemd/fcgiwrap.service | 3 +--
systemd/run-fcgiwrap | 2 ++
systemd/sysconfig.fcgiwrap | 11 +++++++++++
3 files changed, 14 insertions(+), 2 deletions(-)
create mode 100644 systemd/run-fcgiwrap
diff --git a/systemd/fcgiwrap.service b/systemd/fcgiwrap.service
index b22f5e1..cd9ac22 100644
--- a/systemd/fcgiwrap.service
+++ b/systemd/fcgiwrap.service
@@ -3,10 +3,9 @@ Description=Simple CGI Server
After=nss-user-lookup.target
[Service]
-Environment=FCGI_WORKERS=1
EnvironmentFile=-/etc/sysconfig/fcgiwrap
Type=simple
-ExecStart=/usr/sbin/fcgiwrap -c $FCGI_WORKERS
+ExecStart=/usr/sbin/run-fcgiwrap
User=nginx
Group=nginx
diff --git a/systemd/run-fcgiwrap b/systemd/run-fcgiwrap
new file mode 100644
index 0000000..5c10854
--- /dev/null
+++ b/systemd/run-fcgiwrap
@@ -0,0 +1,2 @@
+#! /bin/bash
+exec /usr/sbin/fcgiwrap -c ${FCGI_WORKERS:-1} "${FCGI_ALLOWED[@]/#/-p }"
diff --git a/systemd/sysconfig.fcgiwrap b/systemd/sysconfig.fcgiwrap
index 29de03e..32a8e3d 100644
--- a/systemd/sysconfig.fcgiwrap
+++ b/systemd/sysconfig.fcgiwrap
@@ -11,3 +11,14 @@
# Number of FastCGI workers to spawn
FCGI_WORKERS="1"
+## Type: string
+## Default: ""
+## ServiceReload: fcgiwrap
+# A space-separated list of allowed CGI programs.
+#
+# If this is non-empty, attempts to call a CGI program not
+# in the list will cause a HTTP 403-Forbidden error.
+# Specify programs with full path, wildcards don't work.
+# Paths need to match the script name passed by the server
+# exactly.
+FCGI_ALLOWED=""
--
2.20.1