glib: rebase SO_PEERCRED support

This commit is contained in:
Jeremy Soller 2025-11-10 12:38:08 -07:00
parent 4bcb811e0e
commit 8e492423c1
No known key found for this signature in database
GPG Key ID: 670FDFB5428E05CA

View File

@ -1,6 +1,6 @@
diff -ruwN source-old/fuzzing/fuzz_resolver.c source/fuzzing/fuzz_resolver.c
--- source-old/fuzzing/fuzz_resolver.c 2025-11-03 05:42:10.000000000 -0700
+++ source/fuzzing/fuzz_resolver.c 2025-11-10 12:32:52.477409492 -0700
+++ source/fuzzing/fuzz_resolver.c 2025-11-10 12:32:57.663974728 -0700
@@ -29,7 +29,7 @@
gint rrtype)
{
@ -10,9 +10,21 @@ diff -ruwN source-old/fuzzing/fuzz_resolver.c source/fuzzing/fuzz_resolver.c
GList *record_list = NULL;
/* Data too long? */
diff -ruwN source-old/gio/gcredentialsprivate.h source/gio/gcredentialsprivate.h
--- source-old/gio/gcredentialsprivate.h 2025-11-03 05:42:10.000000000 -0700
+++ source/gio/gcredentialsprivate.h 2025-11-10 12:35:09.114747806 -0700
@@ -104,7 +104,7 @@
*/
#undef G_CREDENTIALS_HAS_PID
-#ifdef __linux__
+#if defined(__linux__) || defined(__redox__)
#define G_CREDENTIALS_SUPPORTED 1
#define G_CREDENTIALS_USE_LINUX_UCRED 1
#define G_CREDENTIALS_NATIVE_TYPE G_CREDENTIALS_TYPE_LINUX_UCRED
diff -ruwN source-old/gio/glocalfile.c source/gio/glocalfile.c
--- source-old/gio/glocalfile.c 2025-11-03 05:42:10.000000000 -0700
+++ source/gio/glocalfile.c 2025-11-10 12:32:05.826947018 -0700
+++ source/gio/glocalfile.c 2025-11-10 12:32:57.664235788 -0700
@@ -47,6 +47,10 @@
#include <sys/mount.h>
#endif
@ -26,7 +38,7 @@ diff -ruwN source-old/gio/glocalfile.c source/gio/glocalfile.c
#endif
diff -ruwN source-old/gio/gnetworking.h.in source/gio/gnetworking.h.in
--- source-old/gio/gnetworking.h.in 2025-11-03 05:42:10.000000000 -0700
+++ source/gio/gnetworking.h.in 2025-11-10 12:32:05.827234357 -0700
+++ source/gio/gnetworking.h.in 2025-11-10 12:32:57.664602707 -0700
@@ -40,13 +40,17 @@
#include <netdb.h>
#include <netinet/in.h>
@ -47,7 +59,7 @@ diff -ruwN source-old/gio/gnetworking.h.in source/gio/gnetworking.h.in
#ifndef __GI_SCANNER__
diff -ruwN source-old/gio/gthreadedresolver.c source/gio/gthreadedresolver.c
--- source-old/gio/gthreadedresolver.c 2025-11-03 05:42:10.000000000 -0700
+++ source/gio/gthreadedresolver.c 2025-11-10 12:32:05.827396051 -0700
+++ source/gio/gthreadedresolver.c 2025-11-10 12:32:57.664870630 -0700
@@ -698,7 +698,7 @@
}
@ -70,9 +82,39 @@ diff -ruwN source-old/gio/gthreadedresolver.c source/gio/gthreadedresolver.c
gint len = 512;
gint herr;
GByteArray *answer;
diff -ruwN source-old/gio/gunixconnection.c source/gio/gunixconnection.c
--- source-old/gio/gunixconnection.c 2025-11-03 05:42:10.000000000 -0700
+++ source/gio/gunixconnection.c 2025-11-10 12:36:14.017908505 -0700
@@ -496,7 +496,7 @@
GSocket *socket;
gint n;
gssize num_bytes_read;
-#ifdef __linux__
+#if defined(__linux__) || defined(__redox__)
gboolean turn_off_so_passcreds;
#endif
@@ -512,7 +512,7 @@
* already. We also need to turn it off when we're done. See
* #617483 for more discussion.
*/
-#ifdef __linux__
+#if defined(__linux__) || defined(__redox__)
{
gint opt_val;
@@ -626,7 +626,7 @@
out:
-#ifdef __linux__
+#if defined(__linux__) || defined(__redox__)
if (turn_off_so_passcreds)
{
if (!g_socket_set_option (socket,
diff -ruwN source-old/gio/gunixmounts.c source/gio/gunixmounts.c
--- source-old/gio/gunixmounts.c 2025-11-03 05:42:10.000000000 -0700
+++ source/gio/gunixmounts.c 2025-11-10 12:32:05.827736880 -0700
+++ source/gio/gunixmounts.c 2025-11-10 12:32:57.665218112 -0700
@@ -1114,7 +1114,7 @@
}
@ -113,7 +155,7 @@ diff -ruwN source-old/gio/gunixmounts.c source/gio/gunixmounts.c
#error No g_get_mount_table() implementation for system
diff -ruwN source-old/gio/meson.build source/gio/meson.build
--- source-old/gio/meson.build 2025-11-03 05:42:10.000000000 -0700
+++ source/gio/meson.build 2025-11-10 12:32:05.828195962 -0700
+++ source/gio/meson.build 2025-11-10 12:32:57.665641216 -0700
@@ -18,7 +18,7 @@
gnetworking_h_nameser_compat_include = ''
@ -132,9 +174,21 @@ diff -ruwN source-old/gio/meson.build source/gio/meson.build
# res_query()
res_query_test = '''#include <resolv.h>
int main (int argc, char ** argv) {
diff -ruwN source-old/gio/tests/gdbus-server-auth.c source/gio/tests/gdbus-server-auth.c
--- source-old/gio/tests/gdbus-server-auth.c 2025-11-03 05:42:10.000000000 -0700
+++ source/gio/tests/gdbus-server-auth.c 2025-11-10 12:36:39.750972219 -0700
@@ -243,7 +243,7 @@
}
else /* We should prefer EXTERNAL whenever it is allowed. */
{
-#ifdef __linux__
+#if defined(__linux__) || defined(__redox__)
/* We know that both GDBus and libdbus support full credentials-passing
* on Linux. */
g_assert_cmpint (uid, ==, getuid ());
diff -ruwN source-old/glib/glib-unix.c source/glib/glib-unix.c
--- source-old/glib/glib-unix.c 2025-11-03 05:42:10.000000000 -0700
+++ source/glib/glib-unix.c 2025-11-10 12:32:05.828400637 -0700
+++ source/glib/glib-unix.c 2025-11-10 12:32:57.665846181 -0700
@@ -74,6 +74,10 @@
#include <sys/user.h>
#endif /* defined (__FreeBSD__ )*/