aboutsummaryrefslogtreecommitdiff
path: root/devel/gamin
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2005-07-17 20:56:43 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2005-07-17 20:56:43 +0000
commitf2add69a0196c650e52178453d285437840d8f7d (patch)
tree84ea4685607b452a05099a090d54de3dd3dbf9c7 /devel/gamin
parenta51c850b381dbe08f90eeb73a7dfcad7faec1bc2 (diff)
downloadports-f2add69a0196c650e52178453d285437840d8f7d.tar.gz
ports-f2add69a0196c650e52178453d285437840d8f7d.zip
Notes
Diffstat (limited to 'devel/gamin')
-rw-r--r--devel/gamin/Makefile2
-rw-r--r--devel/gamin/files/patch-libgamin_gam_api.c77
-rw-r--r--devel/gamin/files/patch-server_gam_channel.c77
3 files changed, 141 insertions, 15 deletions
diff --git a/devel/gamin/Makefile b/devel/gamin/Makefile
index f6513c33aff0..6f4c21ea032a 100644
--- a/devel/gamin/Makefile
+++ b/devel/gamin/Makefile
@@ -7,7 +7,7 @@
PORTNAME= gamin
PORTVERSION= 0.1.2
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES?= devel
MASTER_SITES= http://www.gnome.org/~veillard/gamin/sources/
diff --git a/devel/gamin/files/patch-libgamin_gam_api.c b/devel/gamin/files/patch-libgamin_gam_api.c
index 37a239537f3e..296cd00014ae 100644
--- a/devel/gamin/files/patch-libgamin_gam_api.c
+++ b/devel/gamin/files/patch-libgamin_gam_api.c
@@ -1,5 +1,5 @@
---- libgamin/gam_api.c.orig Sat Jul 16 14:50:35 2005
-+++ libgamin/gam_api.c Sat Jul 16 15:05:33 2005
+--- libgamin/gam_api.c.orig Sun Jul 17 16:48:54 2005
++++ libgamin/gam_api.c Sun Jul 17 16:53:58 2005
@@ -14,6 +14,7 @@
#include <sys/socket.h>
#include <sys/un.h>
@@ -8,16 +8,33 @@
#include "fam.h"
#include "gam_protocol.h"
#include "gam_data.h"
-@@ -421,7 +422,7 @@ gamin_write_credential_byte(int fd)
+@@ -421,10 +422,10 @@ gamin_write_credential_byte(int fd)
{
char data[2] = { 0, 0 };
int written;
-#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS)
+- struct {
+#if defined(HAVE_CMSGCRED) && (!defined(LOCAL_CREDS) || defined(__FreeBSD__))
- struct {
++ union {
struct cmsghdr hdr;
- struct cmsgcred cred;
-@@ -445,7 +446,7 @@ gamin_write_credential_byte(int fd)
+- struct cmsgcred cred;
++ char cred[CMSG_SPACE (sizeof (struct cmsgcred))];
+ } cmsg;
+ struct iovec iov;
+ struct msghdr msg;
+@@ -436,16 +437,16 @@ gamin_write_credential_byte(int fd)
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+
+- msg.msg_control = &cmsg;
+- msg.msg_controllen = sizeof (cmsg);
++ msg.msg_control = (caddr_t) &cmsg;
++ msg.msg_controllen = CMSG_SPACE (sizeof (struct cmsgcred));
+ memset (&cmsg, 0, sizeof (cmsg));
+- cmsg.hdr.cmsg_len = sizeof (cmsg);
++ cmsg.hdr.cmsg_len = CMSG_LEN (sizeof (struct cmsgcred));
+ cmsg.hdr.cmsg_level = SOL_SOCKET;
+ cmsg.hdr.cmsg_type = SCM_CREDS;
#endif
retry:
@@ -26,7 +43,18 @@
written = sendmsg(fd, &msg, 0);
#else
written = write(fd, &data[0], 1);
-@@ -655,7 +656,7 @@ gamin_check_cred(GAMDataPtr conn, int fd
+@@ -647,15 +648,16 @@ gamin_check_cred(GAMDataPtr conn, int fd
+ gid_t c_gid;
+
+ #ifdef HAVE_CMSGCRED
+- struct {
++ struct cmsgcred *cred;
++ union {
+ struct cmsghdr hdr;
+- struct cmsgcred cred;
++ char cred[CMSG_SPACE (sizeof (struct cmsgcred))];
+ } cmsg;
+ #endif
s_uid = getuid();
@@ -35,3 +63,38 @@
/* Set the socket to receive credentials on the next message */
{
int on = 1;
+@@ -676,8 +678,8 @@ gamin_check_cred(GAMDataPtr conn, int fd
+
+ #ifdef HAVE_CMSGCRED
+ memset(&cmsg, 0, sizeof(cmsg));
+- msg.msg_control = &cmsg;
+- msg.msg_controllen = sizeof(cmsg);
++ msg.msg_control = (caddr_t) &cmsg;
++ msg.msg_controllen = CMSG_SPACE (sizeof (struct cmsgcred));
+ #endif
+
+ retry:
+@@ -694,7 +696,8 @@ retry:
+ goto failed;
+ }
+ #ifdef HAVE_CMSGCRED
+- if (cmsg.hdr.cmsg_len < sizeof(cmsg) || cmsg.hdr.cmsg_type != SCM_CREDS) {
++ if (cmsg.hdr.cmsg_len < CMSG_LEN (sizeof (struct cmsgcred))
++ || cmsg.hdr.cmsg_type != SCM_CREDS) {
+ GAM_DEBUG(DEBUG_INFO,
+ "Message from recvmsg() was not SCM_CREDS\n");
+ goto failed;
+@@ -720,9 +723,10 @@ retry:
+ goto failed;
+ }
+ #elif defined(HAVE_CMSGCRED)
+- c_pid = cmsg.cred.cmcred_pid;
+- c_uid = cmsg.cred.cmcred_euid;
+- c_gid = cmsg.cred.cmcred_groups[0];
++ cred = (struct cmsgcred *) CMSG_DATA (&cmsg);
++ c_pid = cred->cmcred_pid;
++ c_uid = cred->cmcred_euid;
++ c_gid = cred->cmcred_groups[0];
+ #else /* !SO_PEERCRED && !HAVE_CMSGCRED */
+ GAM_DEBUG(DEBUG_INFO,
+ "Socket credentials not supported on this OS\n");
diff --git a/devel/gamin/files/patch-server_gam_channel.c b/devel/gamin/files/patch-server_gam_channel.c
index d50203ff7ef6..3c4905953aa8 100644
--- a/devel/gamin/files/patch-server_gam_channel.c
+++ b/devel/gamin/files/patch-server_gam_channel.c
@@ -1,15 +1,32 @@
---- server/gam_channel.c.orig Thu May 19 20:45:51 2005
-+++ server/gam_channel.c Thu May 19 20:47:36 2005
-@@ -29,7 +29,7 @@
+--- server/gam_channel.c.orig Sun Jul 17 16:48:54 2005
++++ server/gam_channel.c Sun Jul 17 16:51:45 2005
+@@ -29,10 +29,10 @@ gam_client_conn_send_cred(int fd)
{
char data[2] = { 0, 0 };
int written;
-#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS)
+- struct {
+#if defined(HAVE_CMSGCRED) && (!defined(LOCAL_CREDS) || defined(__FreeBSD__))
- struct {
++ union {
struct cmsghdr hdr;
- struct cmsgcred cred;
-@@ -53,7 +53,7 @@
+- struct cmsgcred cred;
++ char cred[CMSG_SPACE (sizeof (struct cmsgcred))];
+ } cmsg;
+ struct iovec iov;
+ struct msghdr msg;
+@@ -44,16 +44,16 @@ gam_client_conn_send_cred(int fd)
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+
+- msg.msg_control = &cmsg;
+- msg.msg_controllen = sizeof (cmsg);
++ msg.msg_control = (caddr_t) &cmsg;
++ msg.msg_controllen = CMSG_SPACE (sizeof (struct cmsgcred));
+ memset (&cmsg, 0, sizeof (cmsg));
+- cmsg.hdr.cmsg_len = sizeof (cmsg);
++ cmsg.hdr.cmsg_len = CMSG_LEN (sizeof (struct cmsgcred));
+ cmsg.hdr.cmsg_level = SOL_SOCKET;
+ cmsg.hdr.cmsg_type = SCM_CREDS;
#endif
retry:
@@ -18,7 +35,18 @@
written = sendmsg(fd, &msg, 0);
#else
written = write(fd, &data[0], 1);
-@@ -100,7 +100,7 @@
+@@ -92,15 +92,16 @@ gam_client_conn_check_cred(GIOChannel *
+ gid_t c_gid;
+
+ #ifdef HAVE_CMSGCRED
+- struct {
++ struct cmsgcred *cred;
++ union {
+ struct cmsghdr hdr;
+- struct cmsgcred cred;
++ char cred[CMSG_SPACE (sizeof (struct cmsgcred))];
+ } cmsg;
+ #endif
s_uid = getuid();
@@ -27,3 +55,38 @@
/* Set the socket to receive credentials on the next message */
{
int on = 1;
+@@ -121,8 +122,8 @@ gam_client_conn_check_cred(GIOChannel *
+
+ #ifdef HAVE_CMSGCRED
+ memset(&cmsg, 0, sizeof(cmsg));
+- msg.msg_control = &cmsg;
+- msg.msg_controllen = sizeof(cmsg);
++ msg.msg_control = (caddr_t) &cmsg;
++ msg.msg_controllen = CMSG_SPACE (sizeof (struct cmsgcred));
+ #endif
+
+ retry:
+@@ -139,7 +140,8 @@ gam_client_conn_check_cred(GIOChannel *
+ goto failed;
+ }
+ #ifdef HAVE_CMSGCRED
+- if (cmsg.hdr.cmsg_len < sizeof(cmsg) || cmsg.hdr.cmsg_type != SCM_CREDS) {
++ if (cmsg.hdr.cmsg_len < CMSG_LEN (sizeof (struct cmsgcred))
++ || cmsg.hdr.cmsg_type != SCM_CREDS) {
+ GAM_DEBUG(DEBUG_INFO,
+ "Message from recvmsg() was not SCM_CREDS\n");
+ goto failed;
+@@ -165,9 +167,10 @@ gam_client_conn_check_cred(GIOChannel *
+ goto failed;
+ }
+ #elif defined(HAVE_CMSGCRED)
+- c_pid = cmsg.cred.cmcred_pid;
+- c_uid = cmsg.cred.cmcred_euid;
+- c_gid = cmsg.cred.cmcred_groups[0];
++ cred = (struct cmsgcred *) CMSG_DATA (&cmsg);
++ c_pid = cred->cmcred_pid;
++ c_uid = cred->cmcred_euid;
++ c_gid = cred->cmcred_groups[0];
+ #else /* !SO_PEERCRED && !HAVE_CMSGCRED */
+ GAM_DEBUG(DEBUG_INFO,
+ "Socket credentials not supported on this OS\n");