Among many bugfixes, changes and translations: * GIO now has kqueue support for GFileMonitor (BSDs, Mac OS) * GTask (the new GAsyncResult implementation) has landed * We now install a public "gnetworking.h" header that can be used to include the relevant OS-dependent networking headers. This does not really abstract away unix-vs-windows however; error codes, in particular, are incompatible. See NEWS file http://git.gnome.org/browse/glib/plain/NEWS?id=2.36.1 for details. Patches removed: - patch-aj: Per PR pkg/41601: Bug 133344 is closed and compile tested by Joern Clausen - patch-at: Fixed in b26fb3ae (Bug 687600) - patch-cf: Adds sys/param.h - if still needed, should go into gnetworking.h.in XXX might still be needed - patch-cg: Fixed (or changed anyway) in 6f8f1f70 and 52a81a7d (Bug 688681) - patch-ci: Fixed in a33aaad0 (Bug 637013) - patch-glib_goption.c: Fixed in f9a6a974 - patch-glib_tests_include.c: Fixed in d2b7ee62 (Bug 672406) Patches changed: - patch-ak: First chunk fixed in 5fbdd3aa (Bug 691011) - patch-ap: Added NetBSD support to g_credentials_get_unix_pid() First chunk fixed in b377e696 (Bug 623187) - patch-aq: First chunk fixed in b8c13a01 (Bug 688109) Patches added: - patch-gio_glocalfile.c (Reported as Bug 698348)
101 lines
3.8 KiB
Text
101 lines
3.8 KiB
Text
$NetBSD: patch-ap,v 1.5 2013/04/19 22:21:41 prlw1 Exp $
|
|
|
|
--- gio/gcredentials.c.orig 2013-03-13 13:39:09.000000000 +0000
|
|
+++ gio/gcredentials.c
|
|
@@ -81,8 +81,14 @@ struct _GCredentials
|
|
struct ucred native;
|
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
|
struct cmsgcred native;
|
|
-#elif defined(__OpenBSD__)
|
|
+#elif defined(__OpenBSD__) && !defined(__MirBSD__)
|
|
struct sockpeercred native;
|
|
+#elif defined(__NetBSD__) || defined(__MirBSD__)
|
|
+ struct {
|
|
+ pid_t pid;
|
|
+ uid_t uid;
|
|
+ gid_t gid;
|
|
+ } native;
|
|
#else
|
|
#ifdef __GNUC__
|
|
#warning Please add GCredentials support for your OS
|
|
@@ -127,7 +133,7 @@ g_credentials_class_init (GCredentialsCl
|
|
static void
|
|
g_credentials_init (GCredentials *credentials)
|
|
{
|
|
-#ifdef __linux__
|
|
+#if defined(__linux__) || defined(__NetBSD__) || defined(__MirBSD__)
|
|
credentials->native.pid = getpid ();
|
|
credentials->native.uid = geteuid ();
|
|
credentials->native.gid = getegid ();
|
|
@@ -183,7 +189,7 @@ g_credentials_to_string (GCredentials *c
|
|
g_return_val_if_fail (G_IS_CREDENTIALS (credentials), NULL);
|
|
|
|
ret = g_string_new ("GCredentials:");
|
|
-#ifdef __linux__
|
|
+#if defined(__linux__) || defined(__NetBSD__) || defined(__MirBSD__)
|
|
g_string_append (ret, "linux-ucred:");
|
|
if (credentials->native.pid != -1)
|
|
g_string_append_printf (ret, "pid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.pid);
|
|
@@ -248,7 +254,7 @@ g_credentials_is_same_user (GCredentials
|
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
|
|
|
ret = FALSE;
|
|
-#ifdef __linux__
|
|
+#if defined(__linux__) || defined(__NetBSD__) || defined(__MirBSD__)
|
|
if (credentials->native.uid == other_credentials->native.uid)
|
|
ret = TRUE;
|
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
|
@@ -296,7 +302,7 @@ g_credentials_get_native (GCredentials
|
|
|
|
ret = NULL;
|
|
|
|
-#ifdef __linux__
|
|
+#if defined(__linux__) || defined(__NetBSD__) || defined(__MirBSD__)
|
|
if (native_type != G_CREDENTIALS_TYPE_LINUX_UCRED)
|
|
{
|
|
g_warning ("g_credentials_get_native: Trying to get credentials of type %d but only "
|
|
@@ -357,7 +363,7 @@ g_credentials_set_native (GCredentials
|
|
GCredentialsType native_type,
|
|
gpointer native)
|
|
{
|
|
-#ifdef __linux__
|
|
+#if defined(__linux__) || defined(__NetBSD__) || defined(__MirBSD__)
|
|
if (native_type != G_CREDENTIALS_TYPE_LINUX_UCRED)
|
|
{
|
|
g_warning ("g_credentials_set_native: Trying to set credentials of type %d "
|
|
@@ -366,7 +372,7 @@ g_credentials_set_native (GCredentials
|
|
}
|
|
else
|
|
{
|
|
- memcpy (&credentials->native, native, sizeof (struct ucred));
|
|
+ memcpy (&credentials->native, native, sizeof (credentials->native));
|
|
}
|
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
|
if (native_type != G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED)
|
|
@@ -424,7 +430,7 @@ g_credentials_get_unix_user (GCredential
|
|
g_return_val_if_fail (G_IS_CREDENTIALS (credentials), -1);
|
|
g_return_val_if_fail (error == NULL || *error == NULL, -1);
|
|
|
|
-#ifdef __linux__
|
|
+#if defined(__linux__) || defined(__NetBSD__) || defined(__MirBSD__)
|
|
ret = credentials->native.uid;
|
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
|
ret = credentials->native.cmcred_euid;
|
|
@@ -470,7 +476,7 @@ g_credentials_get_unix_pid (GCredentials
|
|
ret = credentials->native.pid;
|
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
|
ret = credentials->native.cmcred_pid;
|
|
-#elif defined(__OpenBSD__)
|
|
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
|
ret = credentials->native.pid;
|
|
#else
|
|
ret = -1;
|
|
@@ -512,7 +518,7 @@ g_credentials_set_unix_user (GCredential
|
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
|
|
|
ret = FALSE;
|
|
-#ifdef __linux__
|
|
+#if defined(__linux__) || defined(__NetBSD__) || defined(__MirBSD__)
|
|
credentials->native.uid = uid;
|
|
ret = TRUE;
|
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|