diff options
Diffstat (limited to 'security/gnome-keyring/files/patch-gnome-keyring.c')
-rw-r--r-- | security/gnome-keyring/files/patch-gnome-keyring.c | 98 |
1 files changed, 18 insertions, 80 deletions
diff --git a/security/gnome-keyring/files/patch-gnome-keyring.c b/security/gnome-keyring/files/patch-gnome-keyring.c index 728352a..27a981e 100644 --- a/security/gnome-keyring/files/patch-gnome-keyring.c +++ b/security/gnome-keyring/files/patch-gnome-keyring.c @@ -1,92 +1,30 @@ ---- gnome-keyring.c.orig Fri May 27 03:54:22 2005 -+++ gnome-keyring.c Sat Jul 16 21:49:24 2005 -@@ -36,6 +36,7 @@ - #include <string.h> - #include <sys/types.h> - #include <sys/socket.h> -+#include <sys/uio.h> - #include <sys/un.h> - #include <stdarg.h> - -@@ -253,11 +254,39 @@ write_credentials_byte_sync (int socket) - { - char buf; - int bytes_written; -+#if defined(HAVE_CMSGCRED) && (!defined(LOCAL_CREDS) || defined(__FreeBSD__)) -+ union { -+ struct cmsghdr hdr; -+ char cred[CMSG_SPACE (sizeof (struct cmsgcred))]; -+ } cmsg; -+ struct iovec iov; -+ struct msghdr msg; -+#endif -+ -+ buf = 0; -+#if defined(HAVE_CMSGCRED) && (!defined(LOCAL_CREDS) || defined(__FreeBSD__)) -+ iov.iov_base = &buf; -+ iov.iov_len = 1; -+ -+ memset (&msg, 0, sizeof (msg)); -+ msg.msg_iov = &iov; -+ msg.msg_iovlen = 1; -+ -+ msg.msg_control = (caddr_t) &cmsg; -+ msg.msg_controllen = CMSG_SPACE (sizeof (struct cmsgcred)); -+ memset (&cmsg, 0, sizeof (cmsg)); +--- gnome-keyring.c.orig Mon Apr 24 06:21:29 2006 ++++ gnome-keyring.c Mon Jun 12 14:24:47 2006 +@@ -275,9 +275,9 @@ write_credentials_byte_sync (int socket) + msg.msg_control = (caddr_t) &cmsg; + msg.msg_controllen = CMSG_SPACE (sizeof (struct cmsgcred)); + memset (&cmsg, 0, sizeof (cmsg)); +- cmsg->cmsg_len = CMSG_LEN (sizeof (struct cmsgcred)); +- cmsg->cmsg_level = SOL_SOCKET; +- cmsg->cmsg_type = SCM_CREDS; + cmsg.hdr.cmsg_len = CMSG_LEN (sizeof (struct cmsgcred)); + cmsg.hdr.cmsg_level = SOL_SOCKET; + cmsg.hdr.cmsg_type = SCM_CREDS; -+#endif + #endif again: +@@ -324,10 +324,10 @@ write_credentials_byte (GnomeKeyringOper -- buf = 0; -+#if defined(HAVE_CMSGCRED) && (!defined(LOCAL_CREDS) || defined(__FreeBSD__)) -+ bytes_written = sendmsg (socket, &msg, 0); -+#else - bytes_written = write (socket, &buf, 1); -+#endif - - if (bytes_written < 0 && errno == EINTR) - goto again; -@@ -275,11 +304,39 @@ write_credentials_byte (GnomeKeyringOper - { - char buf; - int bytes_written; -+#if defined(HAVE_CMSGCRED) && (!defined(LOCAL_CREDS) || defined(__FreeBSD__)) -+ union { -+ struct cmsghdr hdr; -+ char cred[CMSG_SPACE (sizeof (struct cmsgcred))]; -+ } cmsg; -+ struct iovec iov; -+ struct msghdr msg; -+#endif -+ -+ buf = 0; -+#if defined(HAVE_CMSGCRED) && (!defined(LOCAL_CREDS) || defined(__FreeBSD__)) -+ iov.iov_base = &buf; -+ iov.iov_len = 1; -+ -+ memset (&msg, 0, sizeof (msg)); -+ msg.msg_iov = &iov; -+ msg.msg_iovlen = 1; -+ -+ msg.msg_control = (caddr_t) &cmsg; -+ msg.msg_controllen = CMSG_SPACE (sizeof (struct cmsgcred)); + msg.msg_control = (caddr_t) &cmsg; + msg.msg_controllen = CMSG_SPACE (sizeof (struct cmsgcred)); +- memset (cmsg, 0, sizeof (cmsg)); +- cmsg->cmsg_len = CMSG_LEN (sizeof (struct cmsgcred)); +- cmsg->cmsg_level = SOL_SOCKET; +- cmsg->cmsg_type = SCM_CREDS; + memset (&cmsg, 0, sizeof (cmsg)); + cmsg.hdr.cmsg_len = CMSG_LEN (sizeof (struct cmsgcred)); + cmsg.hdr.cmsg_level = SOL_SOCKET; + cmsg.hdr.cmsg_type = SCM_CREDS; -+#endif + #endif again: - -- buf = 0; -+#if defined(HAVE_CMSGCRED) && (!defined(LOCAL_CREDS) || defined(__FreeBSD__)) -+ bytes_written = sendmsg (op->socket, &msg, 0); -+#else - bytes_written = write (op->socket, &buf, 1); -+#endif - - if (bytes_written < 0 && errno == EINTR) - goto again; |