aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-05-13 22:33:40 +0200
committerKim Alvefur <zash@zash.se>2015-05-13 22:33:40 +0200
commit539f4b561436344e095cc945afe6301edf272250 (patch)
tree158e57da633fa8d8553805dcd190a93b767d7f9a /util
parent70e77200f7789e9fb606c7e99e30a54aca70c5c5 (diff)
parentd6a59152ea90202fa09ba8e6ba7386b68978b181 (diff)
downloadprosody-539f4b561436344e095cc945afe6301edf272250.tar.gz
prosody-539f4b561436344e095cc945afe6301edf272250.zip
Merge 0.10->trunk
Diffstat (limited to 'util')
-rw-r--r--util/datamanager.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua
index b4138638..a107d95c 100644
--- a/util/datamanager.lua
+++ b/util/datamanager.lua
@@ -348,8 +348,12 @@ end
function purge(username, host)
local host_dir = format("%s/%s/", data_path, encode(host));
+ local ok, iter, state, var = pcall(lfs.dir, host_dir);
+ if not ok then
+ return ok, iter;
+ end
local errs = {};
- for file in lfs.dir(host_dir) do
+ for file in iter, state, var do
if lfs.attributes(host_dir..file, "mode") == "directory" then
local store = decode(file);
local ok, err = do_remove(getpath(username, host, store));