]> git.ipfire.org Git - thirdparty/qemu.git/commit
glib-compat: add g_unix_get_passwd_entry_qemu()
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 20 Oct 2020 08:12:51 +0000 (12:12 +0400)
committerMichael Roth <michael.roth@amd.com>
Tue, 3 Nov 2020 01:52:08 +0000 (19:52 -0600)
commit6d593ab451c490b0ca941c6a519894231634751e
tree10c16308c6f477e331ed54c2c42900154003ab2e
parentc67d2efd9d1771fd886e3b58771adaa62897f3d9
glib-compat: add g_unix_get_passwd_entry_qemu()

The glib function was introduced in 2.64. It's a safer version of
getpwnam, and also simpler to use than getpwnam_r.

Currently, it's only use by the next patch in qemu-ga, which doesn't
(well well...) need the thread safety guarantees. Since the fallback
version is still unsafe, I would rather keep the _qemu postfix, to make
sure it's not being misused by mistake. When/if necessary, we can
implement a safer fallback and drop the _qemu suffix.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
*fix checkpatch warnings about newlines before/after block comments
Signed-off-by: Michael Roth <michael.roth@amd.com>
include/glib-compat.h