aboutsummaryrefslogtreecommitdiffstats
path: root/prosodyctl
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-10-24 17:13:49 +0200
committerKim Alvefur <zash@zash.se>2018-10-24 17:13:49 +0200
commit2dd5ee93572d91455ad7bcf84e9555b756c5ffc5 (patch)
treebc074d699a2a38fda8df33742a84ece406017b98 /prosodyctl
parentd3d71d91bb20d92843483063086a5f685b84710d (diff)
downloadprosody-2dd5ee93572d91455ad7bcf84e9555b756c5ffc5.tar.gz
prosody-2dd5ee93572d91455ad7bcf84e9555b756c5ffc5.zip
prosodyctl: Change ownership of certs to same as the cert base dir when running from a source checkout
Diffstat (limited to 'prosodyctl')
-rwxr-xr-xprosodyctl5
1 files changed, 4 insertions, 1 deletions
diff --git a/prosodyctl b/prosodyctl
index 380f8e04..76bf4e12 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -867,7 +867,10 @@ local function copy(from, to, umask, owner, group)
end
assert(input:close());
assert(output:close());
- if owner and group then
+ if not prosody.installed then
+ -- FIXME this is possibly specific to GNU chown
+ os.execute(("chown -c --reference=%s %s"):format(sh_esc(cert_basedir), sh_esc(to)));
+ elseif owner and group then
local ok = os.execute(("chown %s:%s %s"):format(sh_esc(owner), sh_esc(group), sh_esc(to)));
assert(ok == true or ok == 0, "Failed to change ownership of "..to);
end