diff options
author | Kim Alvefur <zash@zash.se> | 2015-05-13 22:31:59 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2015-05-13 22:31:59 +0200 |
commit | cedc24858c35741d5131bbf4840d4f83dfb7b9bb (patch) | |
tree | a1194a8507fd6aba43f775983a36e82bbb8c2448 /util/datamanager.lua | |
parent | 2f7ac943416fa13023e9d061ffc8020811a4ebf0 (diff) | |
parent | ecb35aa0e93c449e422fc385e2e2b679b7082b8c (diff) | |
download | prosody-cedc24858c35741d5131bbf4840d4f83dfb7b9bb.tar.gz prosody-cedc24858c35741d5131bbf4840d4f83dfb7b9bb.zip |
Merge 0.9->0.10
Diffstat (limited to 'util/datamanager.lua')
-rw-r--r-- | util/datamanager.lua | 6 |
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)); |