Comparison

mod_storage_appendmap/mod_storage_appendmap.lua @ 5061:e44b868cc575

mod_storage_appendmap: Fix keyvalue writes store_raw() takes a filename, unlike most other datamanager functions that take a series of path components, leading to this bug where it would write the hostname into a file named after the first argument (commonly a username) in the working directory.
author Kim Alvefur <zash@zash.se>
date Sun, 09 Oct 2022 21:35:18 +0200
parent 2796:6a7b7cb7148e
child 5713:ea6c18ec0669
comparison
equal deleted inserted replaced
5060:bc491065c221 5061:e44b868cc575
104 return map.get(self, user, nil); 104 return map.get(self, user, nil);
105 end 105 end
106 106
107 function keyval:set(user, keyvalues) 107 function keyval:set(user, keyvalues)
108 local data = serialize_map(keyvalues); 108 local data = serialize_map(keyvalues);
109 return dm.store_raw(user, module.host, self.store, "map", data); 109 return dm.store_raw(dm.getpath(user, module.host, self.store, "map"), data);
110 end 110 end
111 111
112 -- TODO some kind of periodic compaction thing? 112 -- TODO some kind of periodic compaction thing?
113 function map:_compact(user) 113 function map:_compact(user)
114 local data = self:get(user); 114 local data = self:get(user);