diff options
author | marcus <marcus@FreeBSD.org> | 2005-04-25 13:31:22 +0800 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2005-04-25 13:31:22 +0800 |
commit | a81137e2d0ccf4323d787847df8157e614d6f1d1 (patch) | |
tree | 6195f0ba293996fb06fe4a9c03407bc6ce12a062 | |
parent | 26d35a02c049ec3d5d5f333dbba47336e55ce19d (diff) | |
download | freebsd-ports-graphics-a81137e2d0ccf4323d787847df8157e614d6f1d1.tar.gz freebsd-ports-graphics-a81137e2d0ccf4323d787847df8157e614d6f1d1.tar.zst freebsd-ports-graphics-a81137e2d0ccf4323d787847df8157e614d6f1d1.zip |
Fix gamin on -CURRENT by not using LOCAL_CREDS. While it works, it does
not provide the pid information that the cmsgcred structure gives us.
Gamin will now behave the same way on all versions of FreeBSD.
-rw-r--r-- | devel/gamin/Makefile | 2 | ||||
-rw-r--r-- | devel/gamin/files/patch-libgamin_gam_api.c | 26 | ||||
-rw-r--r-- | devel/gamin/files/patch-server_gam_channel.c | 26 |
3 files changed, 33 insertions, 21 deletions
diff --git a/devel/gamin/Makefile b/devel/gamin/Makefile index 0f41dc558e8..b09b62f384b 100644 --- a/devel/gamin/Makefile +++ b/devel/gamin/Makefile @@ -7,7 +7,7 @@ PORTNAME= gamin PORTVERSION= 0.0.26 -PORTREVISION?= 11 +PORTREVISION?= 12 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 e6e450babbb..3bc8d9d8529 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 Mon Apr 11 04:10:54 2005 -+++ libgamin/gam_api.c Mon Apr 11 04:16:49 2005 +--- libgamin/gam_api.c.orig Mon Apr 25 01:03:31 2005 ++++ libgamin/gam_api.c Mon Apr 25 01:26:45 2005 @@ -13,6 +13,7 @@ #include <sys/stat.h> #include <sys/socket.h> @@ -8,7 +8,7 @@ #include "fam.h" #include "gam_protocol.h" #include "gam_data.h" -@@ -181,7 +182,6 @@ +@@ -181,7 +182,6 @@ gamin_get_socket_dir(void) snprintf(path, MAXPATHLEN, "/tmp/fam-%s", user); path[MAXPATHLEN] = 0; ret = strdup(path); @@ -16,11 +16,11 @@ return (ret); } -@@ -421,9 +421,35 @@ +@@ -421,9 +421,35 @@ gamin_write_credential_byte(int fd) { char data[2] = { 0, 0 }; int written; -+#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS) ++#if defined(HAVE_CMSGCRED) && (!defined(LOCAL_CREDS) || defined(__FreeBSD__)) + struct { + struct cmsghdr hdr; + struct cmsgcred cred; @@ -44,7 +44,7 @@ +#endif retry: -+#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS) ++#if defined(HAVE_CMSGCRED) && (!defined(LOCAL_CREDS) || defined(__FreeBSD__)) + written = sendmsg(fd, &msg, 0); +#else written = write(fd, &data[0], 1); @@ -52,7 +52,7 @@ if (written < 0) { if (errno == EINTR) goto retry; -@@ -616,8 +642,10 @@ +@@ -616,13 +642,15 @@ gamin_check_cred(GAMDataPtr conn, int fd gid_t c_gid; #ifdef HAVE_CMSGCRED @@ -65,7 +65,13 @@ #endif s_uid = getuid(); -@@ -642,9 +670,9 @@ + +-#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; +@@ -642,9 +670,9 @@ gamin_check_cred(GAMDataPtr conn, int fd msg.msg_iovlen = 1; #ifdef HAVE_CMSGCRED @@ -78,7 +84,7 @@ #endif retry: -@@ -661,7 +689,7 @@ +@@ -661,7 +689,7 @@ retry: goto failed; } #ifdef HAVE_CMSGCRED @@ -87,7 +93,7 @@ GAM_DEBUG(DEBUG_INFO, "Message from recvmsg() was not SCM_CREDS\n"); goto failed; -@@ -687,13 +715,9 @@ +@@ -687,13 +715,9 @@ retry: goto failed; } #elif defined(HAVE_CMSGCRED) diff --git a/devel/gamin/files/patch-server_gam_channel.c b/devel/gamin/files/patch-server_gam_channel.c index 42a3ad692c5..2ee33f3dfb2 100644 --- a/devel/gamin/files/patch-server_gam_channel.c +++ b/devel/gamin/files/patch-server_gam_channel.c @@ -1,5 +1,5 @@ ---- server/gam_channel.c.orig Mon Apr 11 04:20:17 2005 -+++ server/gam_channel.c Mon Apr 11 04:21:00 2005 +--- server/gam_channel.c.orig Mon Apr 25 01:03:31 2005 ++++ server/gam_channel.c Mon Apr 25 01:26:09 2005 @@ -6,6 +6,7 @@ #include <sys/socket.h> #include <sys/stat.h> @@ -17,7 +17,7 @@ { char data[2] = { 0, 0 }; + int written; -+#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS) ++#if defined(HAVE_CMSGCRED) && (!defined(LOCAL_CREDS) || defined(__FreeBSD__)) + struct { + struct cmsghdr hdr; + struct cmsgcred cred; @@ -42,7 +42,7 @@ - return(gam_client_conn_write(source, fd, &data[0], 1)); +retry: -+#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS) ++#if defined(HAVE_CMSGCRED) && (!defined(LOCAL_CREDS) || defined(__FreeBSD__)) + written = sendmsg(fd, &msg, 0); +#else + written = write(fd, &data[0], 1); @@ -64,7 +64,7 @@ } /** -@@ -49,8 +92,10 @@ +@@ -49,13 +92,15 @@ gam_client_conn_check_cred(GIOChannel * gid_t c_gid; #ifdef HAVE_CMSGCRED @@ -77,7 +77,13 @@ #endif s_uid = getuid(); -@@ -75,9 +120,9 @@ + +-#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; +@@ -75,9 +120,9 @@ gam_client_conn_check_cred(GIOChannel * msg.msg_iovlen = 1; #ifdef HAVE_CMSGCRED @@ -90,7 +96,7 @@ #endif retry: -@@ -94,7 +139,7 @@ +@@ -94,7 +139,7 @@ gam_client_conn_check_cred(GIOChannel * goto failed; } #ifdef HAVE_CMSGCRED @@ -99,7 +105,7 @@ GAM_DEBUG(DEBUG_INFO, "Message from recvmsg() was not SCM_CREDS\n"); goto failed; -@@ -120,13 +165,9 @@ +@@ -120,13 +165,9 @@ gam_client_conn_check_cred(GIOChannel * goto failed; } #elif defined(HAVE_CMSGCRED) @@ -116,7 +122,7 @@ #else /* !SO_PEERCRED && !HAVE_CMSGCRED */ GAM_DEBUG(DEBUG_INFO, "Socket credentials not supported on this OS\n"); -@@ -149,7 +190,7 @@ +@@ -149,7 +190,7 @@ gam_client_conn_check_cred(GIOChannel * goto failed; } @@ -125,7 +131,7 @@ GAM_DEBUG(DEBUG_INFO, "Failed to send credential byte to client\n"); goto failed; } -@@ -305,6 +346,7 @@ +@@ -305,6 +346,7 @@ gam_get_socket_path(const char *session) gam_client_id = g_getenv("GAM_CLIENT_ID"); if (gam_client_id == NULL) { GAM_DEBUG(DEBUG_INFO, "Error getting GAM_CLIENT_ID\n"); |