Moved from bug 96577 and fixes from partial review at https://bugs.freedesktop.org/show_bug.cgi?id=96577#c62 has been applied.
Created attachment 129263 [details] [review] On bus startup check given auth in config file against supported mechanisms. With recent code starting dbus-daemon with an unsupported auth mechanism let dbus-daemon silently ignore this issue. Clients connecting to this server fails to connect without any descriptive explanation of the root cause, only the message 'Rejected client connection due to lack of memory' error is reported in dbus-daemon verbose log, which is disabled in production environments. With this patch dbus-daemon checks the supported auth mechanisms on startup and shuts down with a descriptive error message, which gives admins an immediate feedback on service startup/restart. Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de> Bug:
Comment on attachment 129263 [details] [review] On bus startup check given auth in config file against supported mechanisms. Review of attachment 129263 [details] [review]: ----------------------------------------------------------------- ::: dbus/dbus-auth.c @@ +2863,5 @@ > + int i; > + _dbus_assert (buffer != NULL); > + > + i = 0; > + while (all_mechanisms[i].mechanism != NULL) You could turn this `while` loop into a `for` and compress the book-keeping code for `i` a bit. ::: dbus/dbus-auth.h @@ +92,5 @@ > > void _dbus_auth_set_unix_fd_possible(DBusAuth *auth, dbus_bool_t b); > dbus_bool_t _dbus_auth_get_unix_fd_negotiated(DBusAuth *auth); > +DBUS_PRIVATE_EXPORT > +dbus_bool_t _dbus_auth_is_supported_mechanism(DBusString *name); Column alignment is a bit odd for the parameter here.
Comment on attachment 129263 [details] [review] On bus startup check given auth in config file against supported mechanisms. Review of attachment 129263 [details] [review]: ----------------------------------------------------------------- What Philip said.
Created attachment 129279 [details] [review] On bus startup check given auth in config file against supported mechanisms - use for loop - indention fix Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Comment on attachment 129279 [details] [review] On bus startup check given auth in config file against supported mechanisms Review of attachment 129279 [details] [review]: ----------------------------------------------------------------- LGTM with this nitpick. ::: dbus/dbus-auth.c @@ +2859,5 @@ > + */ > +dbus_bool_t > +_dbus_auth_dump_supported_mechanisms (DBusString *buffer) > +{ > + int i; unsigned int.
commit pushed to git master
(In reply to Ralf Habacker from comment #6) > commit pushed to git master ... with mentioned fix applied.
(Will be in 1.11.10)
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.