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>
Thu, 2 Jul 2020 09:08:45 +0000 (10:08 +0100)
commit37b36d49a67b0aee09051f5f76d33f69b67709ab
tree6db60fea9e6c0e8ddabdc0829cfc3625b7b00800
parent732284d5302c19026356b82d8f39e70cf5fe7725
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>
(cherry picked from commit 6ee66ff7bcc91803111d950512f02651e664f74f)
dbus/dbus-userdb-util.c
dbus/dbus-userdb.c
dbus/dbus-userdb.h