gio: add gcredential support for macOS

[smcv: Apply my review feedback from
<https://bugzilla.gnome.org/show_bug.cgi?id=668866>]

Co-authored-by: Simon McVittie <smcv@collabora.com>
Resolves: https://gitlab.gnome.org/GNOME/glib/issues/507
This commit is contained in:
Dr. Michael Lauer
2018-02-18 15:26:54 +01:00
committed by Philip Withnall
parent 05cb229082
commit ec2f60a008
7 changed files with 124 additions and 2 deletions

View File

@@ -99,6 +99,14 @@ test_basic (void)
g_assert_cmpuint (native->uid, ==, geteuid ());
g_assert_cmpuint (native->pid, ==, getpid ());
}
#elif G_CREDENTIALS_USE_APPLE_XUCRED
{
struct xucred *native = g_credentials_get_native (creds,
G_CREDENTIALS_TYPE_APPLE_XUCRED);
g_assert_cmpuint (native->cr_version, ==, XUCRED_VERSION);
g_assert_cmpuint (native->cr_uid, ==, geteuid ());
}
#elif G_CREDENTIALS_USE_FREEBSD_CMSGCRED
{
struct cmsgcred *native = g_credentials_get_native (creds,