summaryrefslogtreecommitdiff
path: root/security/gnomekeyring/files
diff options
context:
space:
mode:
Diffstat (limited to 'security/gnomekeyring/files')
-rw-r--r--security/gnomekeyring/files/patch-gnome-keyring-daemon-io.c58
-rw-r--r--security/gnomekeyring/files/patch-gnome-keyring-daemon.c34
-rw-r--r--security/gnomekeyring/files/patch-gnome-keyring.c92
3 files changed, 0 insertions, 184 deletions
diff --git a/security/gnomekeyring/files/patch-gnome-keyring-daemon-io.c b/security/gnomekeyring/files/patch-gnome-keyring-daemon-io.c
deleted file mode 100644
index 9c0e02eb14ff..000000000000
--- a/security/gnomekeyring/files/patch-gnome-keyring-daemon-io.c
+++ /dev/null
@@ -1,58 +0,0 @@
---- gnome-keyring-daemon-io.c.orig Wed May 4 03:17:18 2005
-+++ gnome-keyring-daemon-io.c Sat Jul 16 21:46:13 2005
-@@ -100,14 +100,17 @@ read_unix_socket_credentials (int fd,
- char buf;
-
- #ifdef HAVE_CMSGCRED
-- char cmsgmem[CMSG_SPACE (sizeof (struct cmsgcred))];
-- struct cmsghdr *cmsg = (struct cmsghdr *) cmsgmem;
-+ struct cmsgcred *cred;
-+ union {
-+ struct cmsghdr hdr;
-+ char cred[CMSG_SPACE (sizeof (struct cmsgcred))];
-+ } cmsg;
- #endif
-
- *pid = 0;
- *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 +129,9 @@ read_unix_socket_credentials (int fd,
- msg.msg_iovlen = 1;
-
- #ifdef HAVE_CMSGCRED
-- memset (cmsgmem, 0, sizeof (cmsgmem));
-- msg.msg_control = cmsgmem;
-- msg.msg_controllen = sizeof (cmsgmem);
-+ memset (&cmsg, 0, sizeof (cmsg));
-+ msg.msg_control = (caddr_t) &cmsg;
-+ msg.msg_controllen = CMSG_SPACE (sizeof (struct cmsgcred));
- #endif
-
- again:
-@@ -147,7 +150,8 @@ read_unix_socket_credentials (int fd,
- }
-
- #ifdef HAVE_CMSGCRED
-- if (cmsg->cmsg_len < sizeof (cmsgmem) || cmsg->cmsg_type != SCM_CREDS) {
-+ if (cmsg.hdr.cmsg_len < CMSG_LEN (sizeof (struct cmsgcred)) ||
-+ cmsg.hdr.cmsg_type != SCM_CREDS) {
- g_warning ("Message from recvmsg() was not SCM_CREDS\n");
- return FALSE;
- }
-@@ -168,10 +172,7 @@ read_unix_socket_credentials (int fd,
- return FALSE;
- }
- #elif defined(HAVE_CMSGCRED)
-- struct cmsgcred *cred;
--
-- cred = (struct cmsgcred *) CMSG_DATA (cmsg);
--
-+ cred = (struct cmsgcred *) CMSG_DATA (&cmsg);
- *pid = cred->cmcred_pid;
- *uid = cred->cmcred_euid;
- #else /* !SO_PEERCRED && !HAVE_CMSGCRED */
diff --git a/security/gnomekeyring/files/patch-gnome-keyring-daemon.c b/security/gnomekeyring/files/patch-gnome-keyring-daemon.c
deleted file mode 100644
index 293df59b976f..000000000000
--- a/security/gnomekeyring/files/patch-gnome-keyring-daemon.c
+++ /dev/null
@@ -1,34 +0,0 @@
---- gnome-keyring-daemon.c.orig Tue Jul 20 22:41:27 2004
-+++ gnome-keyring-daemon.c Tue Jul 20 22:43:03 2004
-@@ -121,7 +121,7 @@
- int i;
-
- got_random = FALSE;
--#ifdef __linux__
-+#if defined(__linux__) || defined(__FreeBSD__)
- {
- int fd;
-
-@@ -352,6 +352,22 @@
- app_ref->pathname[len] = 0;
- }
-
-+ }
-+#elif defined(__FreeBSD__)
-+ {
-+ char buffer[1024];
-+ int len;
-+ char *path;
-+
-+ path = g_strdup_printf ("/proc/%d/file", pid);
-+ len = readlink (path, buffer, sizeof (buffer));
-+ g_free (path);
-+
-+ if (len > 0) {
-+ app_ref->pathname = g_malloc (len + 1);
-+ memcpy (app_ref->pathname, buffer, len);
-+ app_ref->pathname[len] = 0;
-+ }
- }
- #endif
-
diff --git a/security/gnomekeyring/files/patch-gnome-keyring.c b/security/gnomekeyring/files/patch-gnome-keyring.c
deleted file mode 100644
index 728352a8b013..000000000000
--- a/security/gnomekeyring/files/patch-gnome-keyring.c
+++ /dev/null
@@ -1,92 +0,0 @@
---- 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));
-+ cmsg.hdr.cmsg_len = CMSG_LEN (sizeof (struct cmsgcred));
-+ cmsg.hdr.cmsg_level = SOL_SOCKET;
-+ cmsg.hdr.cmsg_type = SCM_CREDS;
-+#endif
-
- again:
-
-- 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));
-+ 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
-
- 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;