fastd: fix creation of PID file as non-root user, add secure_handshakes to example config

This commit is contained in:
Matthias Schiffer 2014-01-14 18:51:42 +01:00
parent 9675535afb
commit 5b6988a512
3 changed files with 12 additions and 1 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=fastd
PKG_VERSION:=11
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/72

View File

@ -52,6 +52,9 @@ config fastd sample_config
# WARNING: Only enable this if you know what you are doing, as this can lead to forwarding loops!
option forward 0
# Disable for compatiblity with fastd v10 and older
option secure_handshakes 1
# Limits the maximum number of connections, optional
# option peer_limit 5

View File

@ -296,6 +296,14 @@ start_instance() {
return 1
fi
rm -f "$SERVICE_PID_FILE"
touch "$SERVICE_PID_FILE"
config_get user "$s" user
if [ "$user" ]; then
chown "$user" "$SERVICE_PID_FILE"
fi
(generate_config_secret "$secret"; generate_config "$s") | service_start "$FASTD_COMMAND" --config - --daemon --pid-file "$SERVICE_PID_FILE"
if ! ifconfig "$interface" >/dev/null 2>&1; then