New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sbus: check connection for NULL before unregister it #232
Conversation
We should also set |
src/sbus/sssd_dbus_interface.c
Outdated
@@ -490,7 +490,13 @@ sbus_opath_hash_delete_cb(hash_entry_t *item, | |||
conn = talloc_get_type(pvt, struct sbus_connection); | |||
path = sbus_opath_get_base_path(NULL, item->key.str); | |||
|
|||
dbus_connection_unregister_object_path(conn->dbus.conn, path); | |||
/* There seem to be code paths where the data is a added to the hash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/is a added/is added
There seem to be code paths where the data is a added to the hash before the connection is properly initialized, to avoid core dump during shut down we only call dbus_conection_unregister_object_path() if there is a connection. Resolves https://pagure.io/SSSD/sssd/issue/3367
2cb9eb0
to
8ece0bd
Compare
I fixed the typo. I'm not sure about
Since the connections are ref-counted in libdbus both calls will just modify dbus.conn but not make it unusable for later usage. E.g. if I understand it correctly dbus_connection_close() will not reduce the ref count, so dbus_connection_unref() should always be called on the close connection. |
There seem to be code paths where the data is a added to the hash before
the connection is properly initialized, to avoid core dump during shut
down we only call dbus_conection_unregister_object_path() if there is a
connection.
Resolves https://pagure.io/SSSD/sssd/issue/3367