Skip to content

Commit be35b55

Browse files
authored
Merge pull request #623 from kevinoid/fix-well-known-perms
Avoid permissions errors for chown .well-known
2 parents a16ccf4 + 22dfedf commit be35b55

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

acme.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -5005,9 +5005,11 @@ $_authorizations_map"
50055005

50065006
_debug "Writing token: $token to $wellknown_path/$token"
50075007

5008-
mkdir -p "$wellknown_path"
5009-
5010-
if ! printf "%s" "$keyauthorization" >"$wellknown_path/$token"; then
5008+
# Ensure .well-known is visible to web server user/group
5009+
# https://github.com/Neilpang/acme.sh/pull/32
5010+
if ! (umask ugo+rx &&
5011+
mkdir -p "$wellknown_path" &&
5012+
printf "%s" "$keyauthorization" >"$wellknown_path/$token"); then
50115013
_err "$d: Cannot write token to file: $wellknown_path/$token"
50125014
_clearupwebbroot "$_currentRoot" "$removelevel" "$token"
50135015
_clearup

0 commit comments

Comments
 (0)