]> git.ipfire.org Git - thirdparty/dbus.git/commit
userdb: Make lookups return a const pointer
authorSimon McVittie <smcv@collabora.com>
Tue, 30 Jun 2020 18:13:17 +0000 (19:13 +0100)
committerSimon McVittie <smcv@collabora.com>
Tue, 30 Jun 2020 18:13:17 +0000 (19:13 +0100)
commit6ee66ff7bcc91803111d950512f02651e664f74f
tree71f07a0292b032a5fa2863bd810310a0171485bb
parentce9682ecc328e87285bcbd85e7915388fd556507
userdb: Make lookups return a const pointer

This makes it more obvious that the returned pointer points to a
struct owned by the userdb, which must not be freed or have its
contents modified, and is only valid to dereference until the next
modification to the userdb's underlying hash tables (which in practice
means until the lock is released, because after that we have no
guarantees about what might be going on in another thread).

Signed-off-by: Simon McVittie <smcv@collabora.com>
dbus/dbus-userdb-util.c
dbus/dbus-userdb.c
dbus/dbus-userdb.h