Software /
code /
prosody
Comparison
util/datamanager.lua @ 1732:f1282fad2f99
datamanager: Fixed logging errors on deletion of datastores not owned by a user@host
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sun, 06 Sep 2009 01:33:41 +0500 |
parent | 1523:841d61be198f |
child | 2159:2ef4458b23d9 |
comparison
equal
deleted
inserted
replaced
1731:38d87682cb4a | 1732:f1282fad2f99 |
---|---|
135 end | 135 end |
136 f:write("return "); | 136 f:write("return "); |
137 append(f, data); | 137 append(f, data); |
138 f:close(); | 138 f:close(); |
139 if next(data) == nil then -- try to delete empty datastore | 139 if next(data) == nil then -- try to delete empty datastore |
140 log("debug", "Removing empty %s datastore for user %s@%s", datastore, username, host); | 140 log("debug", "Removing empty %s datastore for user %s@%s", datastore, username or "nil", host or "nil"); |
141 os_remove(getpath(username, host, datastore)); | 141 os_remove(getpath(username, host, datastore)); |
142 end | 142 end |
143 -- we write data even when we are deleting because lua doesn't have a | 143 -- we write data even when we are deleting because lua doesn't have a |
144 -- platform independent way of checking for non-exisitng files | 144 -- platform independent way of checking for non-exisitng files |
145 return true; | 145 return true; |
177 append(f, d); | 177 append(f, d); |
178 f:write(");\n"); | 178 f:write(");\n"); |
179 end | 179 end |
180 f:close(); | 180 f:close(); |
181 if next(data) == nil then -- try to delete empty datastore | 181 if next(data) == nil then -- try to delete empty datastore |
182 log("debug", "Removing empty %s datastore for user %s@%s", datastore, username, host); | 182 log("debug", "Removing empty %s datastore for user %s@%s", datastore, username or "nil", host or "nil"); |
183 os_remove(getpath(username, host, datastore, "list")); | 183 os_remove(getpath(username, host, datastore, "list")); |
184 end | 184 end |
185 -- we write data even when we are deleting because lua doesn't have a | 185 -- we write data even when we are deleting because lua doesn't have a |
186 -- platform independent way of checking for non-exisitng files | 186 -- platform independent way of checking for non-exisitng files |
187 return true; | 187 return true; |