In some circumstances, particularly with 'opportunistic_writes' and
'fatal_errors' enabled in the epoll backend, the connection may be closed
halfway through the session close process (because it contains debug logging,
which in the case of the watch:log() command, will trigger a write to the
socket).
The chosen fix is to cache session.conn in a local variable (we already did
this later on, but this pulls it up to the top of the function, which is
generally more correct anyway).
After recent changes, '--foo bar' was working, but '--foo=bar' was not. The
test had a typo (?) (bar != baz) and because util.argparse is not strict by
default, the typo was not caught.
The typo caused the code to take a different path, and bypassed the buggy
handling of --foo=bar options.
I've preserved the existing test (typo and all!) because it's still an
interesting test, and ensures no unintended behaviour changes compared to the
old code.
However I've added a new variant of the test, with strict mode enabled and the
typo fixed. This test failed due to the bug, and this commit introduces a fix.
The :clean_clone() method is designed to provide a new cloned SASL handler,
to be used when starting a fresh SASL negotiation on an existing connection.
The userdata field is currently populated by mod_saslauth with the "read-only"
information that the channel binding methods need to do their stuff.
When :clean_clone() does not preserve this, it causes tracebacks in the cb
profile handlers due to the property being nil.
This does mean that SASL handlers should now not be reused (even when cloned)
across different connections, if they ever could.
This allow a shell-command to provide a 'flags' field, which will automatically
cause the parameters to be fed through argparse.
The rationale is to make it easier for more complex commands to be invoked
from the command line (`prosodyctl shell foo bar ...`). Until now they were
limited to accepting a list of strings, and any complex argument processing
was non-standard and awkward to implement.
Inspired by mod_compliance_*, this command will help people (especially those
with older configs, upgrading from previous releases) learn what features
their Prosody configuration may be missing.
This enables use of encrypted databases if LuaDBI or LuaSQLite3 has been
linked against SQLCipher. Using `LD_PRELOAD` may work as well.
Requires SQLCipher >= 4.0.0 due to the use of UPSERT
Idea is to enable easily retrieving of secret values from files outside
of the config, e.g. via the method used by systemd credentials.
CREDENTIALS_DIRECTORY is expected to be set by the process manager
invoking Prosody, so being unset and unavailable from prosodyctl is
going to be normal and a warning is reported in that case. Care will
have to be taken to make it clear that prosodyctl check will not work
with such values. An error is thrown if the directory is unavailable
when running under Prosody.
Allows granting read only access to other sets of users using a separate
access control capability, which makes sense as some properties may be
intended to be public but read-only.
Removes dependency on util.error from util.pubsub which was only used
for this one special case.
Line count reduction!
Would be even nicer if templating could be done by util.error itself.
This removes the different argument order used between '{x|foo}' and
'{x|foo(y)}' because the differing order was awkward and confusing.
This util does not seem to be widely used so should not be problematic
to change this part. The only known use is in mod_pubsub, which does not
use the filter function feature.