mirror of
https://github.com/openwrt/packages.git
synced 2026-04-15 10:51:55 +00:00
stunnel: create PID directory before alt_config_file return
When alt_config_file is set, global_defs() returns before creating the PID file directory. stunnel then fails to start because it cannot write its PID file to the nonexistent directory. Move the PID directory creation and ownership setup above the alt_config_file early return so it runs regardless of config mode. Fixes: openwrt/openwrt#28982 Signed-off-by: Joshua Klinesmith <joshuaklinesmith@gmail.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
committed by
Florian Eckert
parent
0f729f36b2
commit
9e3c668211
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=stunnel
|
||||
PKG_VERSION:=5.75
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
|
||||
|
||||
@@ -338,6 +338,11 @@ global_defs() {
|
||||
# If the first globals section has alt_config_file, don't process any more globals
|
||||
[ -z "$HAVE_ALT_CONF_FILE" ] || return 0
|
||||
|
||||
pid_dir="$(dirname "$PID_FILE")"
|
||||
mkdir -p "$pid_dir"
|
||||
[ -z "$setuid" ] || chown "$setuid" "$pid_dir"
|
||||
[ -z "$setgid" ] || chown ":$setgid" "$pid_dir"
|
||||
|
||||
# If "alt_config_file" specified in the first globals section, use that instead
|
||||
[ -z "$alt_config_file" ] || [ -n "$CONF_FILE_CREATED" ] || {
|
||||
# Symlink "alt_config_file" since it's a bit easier and safer
|
||||
@@ -349,11 +354,6 @@ global_defs() {
|
||||
return 0
|
||||
}
|
||||
|
||||
pid_dir="$(dirname "$PID_FILE")"
|
||||
mkdir -p "$pid_dir"
|
||||
[ -z "$setuid" ] || chown "$setuid" "$pid_dir"
|
||||
[ -z "$setgid" ] || chown ":$setgid" "$pid_dir"
|
||||
|
||||
create_conf_file
|
||||
print_global_options
|
||||
validate_service_options globals "$1" print_service_options
|
||||
|
||||
Reference in New Issue
Block a user