diff options
author | Kim Alvefur <zash@zash.se> | 2024-08-30 17:41:40 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2024-08-30 17:41:40 +0200 |
commit | f7d0caa5ac8bc4d95bede90b42dd8f794429fc8f (patch) | |
tree | 31ffa9968a7c261cc817e8731a08a16f3eacdec4 /util/prosodyctl | |
parent | 65386e9810670432e06c7fd62f91891f87678c6b (diff) | |
download | prosody-f7d0caa5ac8bc4d95bede90b42dd8f794429fc8f.tar.gz prosody-f7d0caa5ac8bc4d95bede90b42dd8f794429fc8f.zip |
util.prosodyctl.cert: Ensure old cert is moved out of the way
This should make it visible if the move fails
Diffstat (limited to 'util/prosodyctl')
-rw-r--r-- | util/prosodyctl/cert.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/prosodyctl/cert.lua b/util/prosodyctl/cert.lua index 02c81585..abd2e1d6 100644 --- a/util/prosodyctl/cert.lua +++ b/util/prosodyctl/cert.lua @@ -163,7 +163,7 @@ local function copy(from, to, umask, owner, group) local attrs = lfs.attributes(to); if attrs then -- Move old file out of the way local backup = to..".bkp~"..os.date("%FT%T", attrs.change); - os.rename(to, backup); + assert(os.rename(to, backup)); end -- FIXME friendlier error handling, maybe move above backup back? local input = assert(io.open(from)); |