Software / code / prosody
Comparison
prosodyctl @ 9544:cbd3b9d4c60b
prosodyctl: Change ownership of certs to same as the cert base dir when running from a source checkout
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 24 Oct 2018 17:13:49 +0200 |
| parent | 9543:92bfb12684b0 |
| child | 9545:9dc7280dd8dc |
comparison
equal
deleted
inserted
replaced
| 9543:92bfb12684b0 | 9544:cbd3b9d4c60b |
|---|---|
| 865 while data and output:write(data) do | 865 while data and output:write(data) do |
| 866 data = input:read(2^11); | 866 data = input:read(2^11); |
| 867 end | 867 end |
| 868 assert(input:close()); | 868 assert(input:close()); |
| 869 assert(output:close()); | 869 assert(output:close()); |
| 870 if owner and group then | 870 if not prosody.installed then |
| 871 -- FIXME this is possibly specific to GNU chown | |
| 872 os.execute(("chown -c --reference=%s %s"):format(sh_esc(cert_basedir), sh_esc(to))); | |
| 873 elseif owner and group then | |
| 871 local ok = os.execute(("chown %s:%s %s"):format(sh_esc(owner), sh_esc(group), sh_esc(to))); | 874 local ok = os.execute(("chown %s:%s %s"):format(sh_esc(owner), sh_esc(group), sh_esc(to))); |
| 872 assert(ok == true or ok == 0, "Failed to change ownership of "..to); | 875 assert(ok == true or ok == 0, "Failed to change ownership of "..to); |
| 873 end | 876 end |
| 874 if old_umask then pposix.umask(old_umask); end | 877 if old_umask then pposix.umask(old_umask); end |
| 875 return true; | 878 return true; |