From bc0b6d6721573204056fcdf8eb340f84a304a182 Mon Sep 17 00:00:00 2001 From: Joe Marcus Clarke Date: Tue, 26 Apr 2005 06:02:40 +0000 Subject: Fix dbus and gnomekeyring on -CURRENT by not using LOCAL_CREDS. While it works, it does not provide the pid information that the cmsgcred structure gives us. Dbus and gnomekeyring will now behave the same way on all versions of FreeBSD. --- security/gnome-keyring/Makefile | 1 + .../files/patch-gnome-keyring-daemon-io.c | 19 +++++++++++++------ security/gnome-keyring/files/patch-gnome-keyring.c | 20 ++++++++++---------- 3 files changed, 24 insertions(+), 16 deletions(-) (limited to 'security/gnome-keyring') diff --git a/security/gnome-keyring/Makefile b/security/gnome-keyring/Makefile index 3687f5f00afc..f2f30d13b6fa 100644 --- a/security/gnome-keyring/Makefile +++ b/security/gnome-keyring/Makefile @@ -7,6 +7,7 @@ PORTNAME= gnomekeyring PORTVERSION= 0.4.2 +PORTREVISION= 1 CATEGORIES= security gnome MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= sources/gnome-keyring/0.4 diff --git a/security/gnome-keyring/files/patch-gnome-keyring-daemon-io.c b/security/gnome-keyring/files/patch-gnome-keyring-daemon-io.c index 9a283741317c..c89df802497b 100644 --- a/security/gnome-keyring/files/patch-gnome-keyring-daemon-io.c +++ b/security/gnome-keyring/files/patch-gnome-keyring-daemon-io.c @@ -1,6 +1,6 @@ ---- gnome-keyring-daemon-io.c.orig Tue Jan 13 05:29:02 2004 -+++ gnome-keyring-daemon-io.c Fri Dec 17 00:44:55 2004 -@@ -100,8 +100,10 @@ +--- gnome-keyring-daemon-io.c.orig Mon Feb 21 02:50:03 2005 ++++ gnome-keyring-daemon-io.c Tue Apr 26 01:56:16 2005 +@@ -100,14 +100,16 @@ read_unix_socket_credentials (int fd, char buf; #ifdef HAVE_CMSGCRED @@ -13,7 +13,14 @@ #endif *pid = 0; -@@ -126,9 +128,9 @@ + *uid = 0; + +-#if defined(LOCAL_CREDS) && defined(HAVE_CMSGCRED) ++#if defined(LOCAL_CREDS) && defined(HAVE_CMSGCRED) && !defined(__FreeBSD__) + /* Set the socket to receive credentials on the next message */ + { + int on = 1; +@@ -126,9 +128,9 @@ read_unix_socket_credentials (int fd, msg.msg_iovlen = 1; #ifdef HAVE_CMSGCRED @@ -26,7 +33,7 @@ #endif again: -@@ -147,7 +149,8 @@ +@@ -147,7 +149,8 @@ read_unix_socket_credentials (int fd, } #ifdef HAVE_CMSGCRED @@ -36,7 +43,7 @@ g_warning ("Message from recvmsg() was not SCM_CREDS\n"); return FALSE; } -@@ -168,12 +171,8 @@ +@@ -168,12 +171,8 @@ read_unix_socket_credentials (int fd, return FALSE; } #elif defined(HAVE_CMSGCRED) diff --git a/security/gnome-keyring/files/patch-gnome-keyring.c b/security/gnome-keyring/files/patch-gnome-keyring.c index ebac2c91d812..a6f5995515e9 100644 --- a/security/gnome-keyring/files/patch-gnome-keyring.c +++ b/security/gnome-keyring/files/patch-gnome-keyring.c @@ -1,5 +1,5 @@ ---- gnome-keyring.c.orig Tue Sep 7 00:05:37 2004 -+++ gnome-keyring.c Fri Dec 17 10:06:11 2004 +--- gnome-keyring.c.orig Mon Feb 21 02:50:29 2005 ++++ gnome-keyring.c Tue Apr 26 01:57:25 2005 @@ -36,6 +36,7 @@ #include #include @@ -8,11 +8,11 @@ #include #include -@@ -253,11 +254,39 @@ +@@ -253,11 +254,39 @@ write_credentials_byte_sync (int socket) { char buf; int bytes_written; -+#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS) ++#if defined(HAVE_CMSGCRED) && (!defined(LOCAL_CREDS) || defined(__FreeBSD__)) + struct { + struct cmsghdr hdr; + struct cmsgcred cred; @@ -22,7 +22,7 @@ +#endif + + buf = 0; -+#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS) ++#if defined(HAVE_CMSGCRED) && (!defined(LOCAL_CREDS) || defined(__FreeBSD__)) + iov.iov_base = &buf; + iov.iov_len = 1; + @@ -41,7 +41,7 @@ again: - buf = 0; -+#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS) ++#if defined(HAVE_CMSGCRED) && (!defined(LOCAL_CREDS) || defined(__FreeBSD__)) + bytes_written = sendmsg (socket, &msg, 0); +#else bytes_written = write (socket, &buf, 1); @@ -49,11 +49,11 @@ if (bytes_written < 0 && errno == EINTR) goto again; -@@ -275,11 +304,39 @@ +@@ -275,11 +304,39 @@ write_credentials_byte (GnomeKeyringOper { char buf; int bytes_written; -+#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS) ++#if defined(HAVE_CMSGCRED) && (!defined(LOCAL_CREDS) || defined(__FreeBSD__)) + struct { + struct cmsghdr hdr; + struct cmsgcred cred; @@ -63,7 +63,7 @@ +#endif + + buf = 0; -+#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS) ++#if defined(HAVE_CMSGCRED) && (!defined(LOCAL_CREDS) || defined(__FreeBSD__)) + iov.iov_base = &buf; + iov.iov_len = 1; + @@ -82,7 +82,7 @@ again: - buf = 0; -+#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS) ++#if defined(HAVE_CMSGCRED) && (!defined(LOCAL_CREDS) || defined(__FreeBSD__)) + bytes_written = sendmsg (op->socket, &msg, 0); +#else bytes_written = write (op->socket, &buf, 1); -- cgit v1.2.3