Commit graph

114 commits

Author SHA1 Message Date
Kim Alvefur
c9e223e4f7 spelling: non-existing mistakes (thanks timeless) 2022-03-07 00:35:29 +01:00
Kim Alvefur
43351d2b54 Spelling: Fix various spelling mistakes (thanks timeless)
Words, sometimes I wonder how they even work

Maybe I missed something.
2022-03-07 00:13:56 +01:00
Kim Alvefur
ac2d84a47b util.datamanager: Support iterating over any file extension
The 'typ' argument to all other functions is the actual file extension,
but not here for some reason.

May need this for iterating over the .bin files created by
mod_http_file_share in the future.
2021-02-07 19:23:33 +01:00
Kim Alvefur
2f9a03eba0 util.datamanager: Fix not passing variables as format string to logger (thanks semgrep)
Passing error messages as format string could lead to errors, although
not a problem anymore since util.format sanitizes this.
2021-01-16 15:49:46 +01:00
Kim Alvefur
9a83f0e20b Merge 0.11->trunk 2020-02-24 23:33:53 +01:00
Kim Alvefur
d8fda82e40 util.datamanager: Fix iterating over "users" (thanks marc0s)
The 'store' path componend used to be unescaped until 756a2a00e7e7 added
escaping to address issues with characters like '/' used in PEP, but
with a special case for '_' which was already in common use in 'store'
path components.

Missed adding this escaping here.
2020-02-24 23:16:08 +01:00
Kim Alvefur
0bbfb60aae util.datamanager: Ignore unused 'errno' variable [luacheck] 2019-12-23 21:01:55 +01:00
Kim Alvefur
43b814a83b vairious: Add annotation when an empty environment is set [luacheck] 2018-02-28 20:06:26 +01:00
Kim Alvefur
2572082717 util.datamanager: Encode the 'store' path component, preserving underscores 2017-10-08 18:34:57 +02:00
Kim Alvefur
33be2cd463 util.datamanager: Use already known index instead of measuring length each iteration 2017-04-17 03:26:21 +02:00
Kim Alvefur
0f578fb9f3 util.datamanager: Log where the error came from 2017-03-28 17:31:55 +02:00
Kim Alvefur
5c4a8d13e2 util.datamanager: Rearrange locals 2017-03-28 17:31:24 +02:00
Kim Alvefur
7b4ad0e694 util.datamanager: Use pposix.atomic_append 2017-02-28 11:33:43 +01:00
Kim Alvefur
2e06e8e75d util.datamanager: Remove check for file non-existence since ENOENT tells us that already 2017-03-22 12:02:52 +01:00
Kim Alvefur
d496a96705 util.datamanager: Split long line [luacheck] 2017-03-22 12:00:21 +01:00
Kim Alvefur
cb0953029e util.datamanager: Expose atomic_store as store_raw 2017-03-01 17:37:29 +01:00
Kim Alvefur
c3aae40b19 util.datamanager: Use atomic store function when writing the first entry of a list 2017-03-01 17:15:56 +01:00
Kim Alvefur
f0c676e8c6 util.datamanager: Import value of ENOENT from util.pposix (if available) 2017-03-01 17:04:48 +01:00
Kim Alvefur
fc38b8c4f4 util.datamanager: Ignore ENOENT (no such file) when loading data 2017-03-01 16:44:59 +01:00
Kim Alvefur
f65c017ee1 Fix various spelling mistakes [codespell] 2019-05-03 20:54:24 +02:00
Kim Alvefur
f36fed39e8 util.datamanager: Shorter pattern 2016-11-20 12:06:36 +01:00
Kim Alvefur
f0bd3ec403 util.datamanager: Remove extraneous decoding of + to space, which we never never encode to 2016-11-20 12:05:43 +01:00
Kim Alvefur
e3ab638262 util.datamanager: Use the 'base' argument to tonumber() to indicate hexadecimal 2016-11-20 12:03:24 +01:00
Kim Alvefur
d56bd9dbdb util.datamanager: Add annotations to ignore name clashes [luacheck] 2016-09-24 18:31:16 +02:00
Kim Alvefur
c331fe1594 util.datamanager: Rename variables to avoid name clashes [luacheck] 2016-09-24 18:31:00 +02:00
Kim Alvefur
baba98852d util.datamanager: Import tostring and type (fix global access) 2016-05-22 14:38:07 +02:00
Kim Alvefur
afe389d870 util.datamanager: Explicit handling of each error condition (see #632) 2016-02-27 15:29:56 +01:00
Kim Alvefur
d17785e91f Merge 0.9->0.10 2016-02-25 22:37:41 +01:00
Kim Alvefur
fc2ad03510 util.datamanager: Unreference file handle after closing it to prevent trying to close it again (fixes #632) 2016-02-25 22:36:42 +01:00
Kim Alvefur
30b54f4ad7 util.datamanager: Add append to public api 2015-12-11 20:31:55 +01:00
Kim Alvefur
7816dfc838 util.datamanager: Return extra location info 2015-12-11 20:31:19 +01:00
Kim Alvefur
206330cea1 util.datamanager: Make sure only strings are passed as data to append() 2015-12-11 20:30:39 +01:00
Kim Alvefur
1510dd113d util.datamanager: Add some comments about the append function 2015-12-11 20:29:55 +01:00
Kim Alvefur
4b380b1cbf util.datamanager: Handle potential error from :write() call 2015-12-11 20:26:04 +01:00
Kim Alvefur
be1b771edf util.datamanager: Handle potential issues from fallocate 2015-12-11 20:24:36 +01:00
Kim Alvefur
74500e9b50 util.datamanager: No shadowing of variable [luacheck] 2015-12-11 20:22:54 +01:00
Kim Alvefur
74caca930a util.datamanager: Skip past second check if first attemtp to open file succeeds 2015-12-11 20:18:24 +01:00
Kim Alvefur
8ecd4052a5 util.datamanager: In append() collect status when closing file handle as it may fail (eg the implied flush) 2015-12-11 20:13:37 +01:00
Kim Alvefur
2ccee846f2 util.datamanager: Overwrite 'data' variable instead of shadownig it [luacheck] 2015-12-11 20:11:48 +01:00
Kim Alvefur
3e9c86d509 util.datamanager: Factor out code for appending bytes to a file 2015-12-11 20:07:22 +01:00
Kim Alvefur
eaa823a597 util.*: Remove use of module() function, make all module functions local and return them in a table at the end 2015-02-21 10:36:37 +01:00
Kim Alvefur
4beb76ca0d util.datamanager: Fix traceback from trying to purge when storage is empty or otherwise unaccessible (fixes #496) 2015-05-13 21:44:13 +02:00
Kim Alvefur
2064173f3b util.datamanager: Fix traceback due to %s in log message 2015-04-03 12:10:30 +02:00
Kim Alvefur
158dc0f9e1 util.datamanager: Check that the global 'prosody' exists before using it (fixes nil indexing in use outside of prosody) 2015-02-20 19:00:01 +01:00
Matthew Wild
f056043347 util.datamanager: Clear the cache of created directories on storage failure, and retry 2013-04-07 20:28:12 +01:00
Marco Cirillo
2e7d2a24ce util.datamanager: expose path decode and encode functions. 2013-04-07 16:56:49 +00:00
Kim Alvefur
17bfb654df util.datamanager: Don't escape the name of a store 2012-12-16 14:36:24 +01:00
Kim Alvefur
1d8297ca4f util.datamanager: Remove unused variable 2012-12-14 14:25:58 +01:00
Kim Alvefur
4d762f9cbf util.datamanager: Remove dead code path 2012-12-14 14:21:32 +01:00
Kim Alvefur
196022f3f5 mod_storage_internal, datamanager: Add support for iterating over users with data in a store 2012-09-21 17:23:08 +02:00