mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-27 17:52:58 +02:00
GCredentials: Add the concept of credentials that lack the process ID
struct xucred on macOS doesn't have the process ID, only the user ID and groups. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
committed by
Philip Withnall
parent
a9a7aa05dc
commit
05cb229082
@@ -54,9 +54,16 @@ test_basic (void)
|
||||
g_assert_cmpuint (g_credentials_get_unix_user (creds, &error), ==,
|
||||
geteuid ());
|
||||
g_assert_no_error (error);
|
||||
g_assert_cmpuint (g_credentials_get_unix_pid (creds, &error), ==,
|
||||
|
||||
#if G_CREDENTIALS_HAS_PID
|
||||
g_assert_cmpint (g_credentials_get_unix_pid (creds, &error), ==,
|
||||
getpid ());
|
||||
g_assert_no_error (error);
|
||||
#else
|
||||
g_assert_cmpint (g_credentials_get_unix_pid (creds, &error), ==, -1);
|
||||
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED);
|
||||
g_clear_error (&error);
|
||||
#endif
|
||||
|
||||
set = g_credentials_set_unix_user (other, not_me, &error);
|
||||
#if G_CREDENTIALS_SPOOFING_SUPPORTED
|
||||
|
Reference in New Issue
Block a user