mod_storage_appendmap: Fix keyvalue writes
authorKim Alvefur <zash@zash.se>
Sun, 09 Oct 2022 21:35:18 +0200
changeset 5065 e44b868cc575
parent 5064 bc491065c221
child 5066 38a0e3621181
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.
mod_storage_appendmap/mod_storage_appendmap.lua
--- a/mod_storage_appendmap/mod_storage_appendmap.lua	Tue Sep 27 18:23:42 2022 +0100
+++ b/mod_storage_appendmap/mod_storage_appendmap.lua	Sun Oct 09 21:35:18 2022 +0200
@@ -106,7 +106,7 @@
 
 function keyval:set(user, keyvalues)
 	local data = serialize_map(keyvalues);
-	return dm.store_raw(user, module.host, self.store, "map", data);
+	return dm.store_raw(dm.getpath(user, module.host, self.store, "map"), data);
 end
 
 -- TODO some kind of periodic compaction thing?