Skip to content

Commit

Permalink
check socat "Permission denied"
Browse files Browse the repository at this point in the history
  • Loading branch information
neil committed Feb 4, 2024
1 parent 802121d commit 99e5c15
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion acme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2519,12 +2519,21 @@ _startserver() {
_content_len="$(printf "%s" "$content" | wc -c)"
_debug _content_len "$_content_len"
_debug "_NC" "$_NC $SOCAT_OPTIONS"
_socaterr="$(_mktemp)"
$_NC $SOCAT_OPTIONS SYSTEM:"sleep 1; \
echo 'HTTP/1.0 200 OK'; \
echo 'Content-Length\: $_content_len'; \
echo ''; \
printf '%s' '$content';" &
printf '%s' '$content';" 2>"$_socaterr" &
serverproc="$!"
if [ -f "$_socaterr" ]; Then
if grep "Permission denied" "$_socaterr" >/dev/null; Then
_err "socat: $(cat $_socaterr)"
_err "Can not listen for user: $(whoami)"
_err "Maybe try with root again?"
return 1
fi
fi
}

_stopserver() {
Expand Down

0 comments on commit 99e5c15

Please sign in to comment.