View | Details | Raw Unified | Return to bug 256896
Collapse All | Expand All

(-)Makefile (-38 / +21 lines)
Lines 3-63 Link Here
3
3
4
PORTNAME=	gamin
4
PORTNAME=	gamin
5
PORTVERSION=	0.1.10
5
PORTVERSION=	0.1.10
6
PORTREVISION?=	10
6
PORTREVISION=	10
7
CATEGORIES?=	devel
7
CATEGORIES=	devel
8
MASTER_SITES=	http://people.gnome.org/~veillard/gamin/sources/
8
MASTER_SITES=	http://people.gnome.org/~veillard/gamin/sources/
9
9
10
MAINTAINER?=	ports@FreeBSD.org
10
MAINTAINER=	ports@FreeBSD.org
11
COMMENT?=	File and directory monitoring system
11
COMMENT=	File and directory monitoring system
12
12
13
USES+=		gettext gnome libtool pathfix pkgconfig
13
LICENSE=	GPLv2
14
USE_GNOME?=	glib20
14
LICENSE_FILE=	${WRKSRC}/COPYING
15
16
USES=		gettext gnome libtool localbase pathfix pkgconfig
17
USE_GNOME=	glib20
15
USE_LDCONFIG=	yes
18
USE_LDCONFIG=	yes
16
GNU_CONFIGURE=	yes
19
GNU_CONFIGURE=	yes
17
CONFIGURE_ARGS?=--with-html-dir=${PREFIX}/share/doc \
20
CONFIGURE_ARGS=	--with-html-dir=${PREFIX}/share/doc \
18
		--without-python
21
		--without-python
19
CPPFLAGS+=	-DHAVE_LINUX -I${LOCALBASE}/include
20
LIBS+=		-L${LOCALBASE}/lib
21
INSTALL_TARGET=	install-strip
22
INSTALL_TARGET=	install-strip
23
CPPFLAGS+=	-DHAVE_LINUX
22
24
23
CONFLICTS=	fam-[0-9]*
25
CONFLICTS=	fam-[0-9]*
24
26
25
.if !defined(GAMIN_SLAVE)
27
OPTIONS_DEFINE=		GAM_POLLER LIBINOTIFY RUN_AS_EUID
26
OPTIONS_DEFINE=	GAM_POLLER LIBINOTIFY RUN_AS_EUID
28
OPTIONS_DEFAULT=	RUN_AS_EUID
27
OPTIONS_DEFAULT=RUN_AS_EUID
29
GAM_POLLER_DESC=	Use gamin's poller instead of kqueue's
28
GAM_POLLER_DESC=Use gamin's poller instead of kqueue's
30
LIBINOTIFY_DESC=	Use libinotify as the FAM backend
29
LIBINOTIFY_DESC=Use libinotify as the FAM backend
31
RUN_AS_EUID_DESC=	Drop privileges to effective user
30
RUN_AS_EUID_DESC=Drop privileges to effective user
32
GAM_POLLER_VARS=	CPPFLAGS+=-DUSE_GAMIN_POLLER=1
31
.endif
33
LIBINOTIFY_LIB_DEPENDS=	libinotify.so:devel/libinotify
32
34
LIBINOTIFY_CONFIGURE_ENABLE=	inotify
33
.include <bsd.port.options.mk>
35
LIBINOTIFY_VARS=	LIBS+=-linotify
34
36
RUN_AS_EUID_VARS=	CPPFLAGS+=-DRUN_AS_EUID=1
35
.if !defined(GAMIN_SLAVE)
36
.if ${PORT_OPTIONS:MGAM_POLLER}
37
CPPFLAGS+=	-DUSE_GAMIN_POLLER=1
38
.endif
39
40
.if ${PORT_OPTIONS:MLIBINOTIFY}
41
CONFIGURE_ARGS+=--enable-inotify
42
LIBS+=		-linotify
43
LIB_DEPENDS+=	libinotify.so:devel/libinotify
44
.else
45
CONFIGURE_ARGS+=--disable-inotify
46
.endif
47
.endif
48
49
.if ${PORT_OPTIONS:MRUN_AS_EUID}
50
CPPFLAGS+=	-DRUN_AS_EUID=1
51
.endif
52
37
53
post-patch:
38
post-patch:
54
	@${REINPLACE_CMD} "s|/etc|${PREFIX}/etc|g" ${WRKSRC}/server/gam_conf.c
39
	@${REINPLACE_CMD} "s|/etc|${PREFIX}/etc|g" ${WRKSRC}/server/gam_conf.c
55
40
56
.if !defined(GAMIN_SLAVE)
57
regression-test: build
41
regression-test: build
58
	@${ECHO_MSG} "===> Running gamin regression tests"
42
	@${ECHO_MSG} "===> Running gamin regression tests"
59
	@(cd ${WRKSRC}/tests && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} \
43
	@(cd ${WRKSRC}/tests && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} \
60
		Makefile ${MAKE_ARGS} tests)
44
		Makefile ${MAKE_ARGS} tests)
61
.endif
62
45
63
.include <bsd.port.mk>
46
.include <bsd.port.mk>
(-)files/patch-libgamin_gam__api.c (-12 / +12 lines)
Lines 1-5 Link Here
1
--- libgamin/gam_api.c.orig	2007-08-27 03:21:03.000000000 -0700
1
--- libgamin/gam_api.c.orig	2007-08-27 10:21:03 UTC
2
+++ libgamin/gam_api.c	2013-02-16 15:51:11.927100135 -0800
2
+++ libgamin/gam_api.c
3
@@ -14,6 +14,7 @@
3
@@ -14,6 +14,7 @@
4
 #include <sys/socket.h>
4
 #include <sys/socket.h>
5
 #include <sys/un.h>
5
 #include <sys/un.h>
Lines 8-14 Link Here
8
 #include "fam.h"
8
 #include "fam.h"
9
 #include "gam_protocol.h"
9
 #include "gam_protocol.h"
10
 #include "gam_data.h"
10
 #include "gam_data.h"
11
@@ -117,7 +118,11 @@
11
@@ -117,7 +118,11 @@ gamin_get_user_name(void)
12
     if (user_name[0] != 0)
12
     if (user_name[0] != 0)
13
         return (user_name);
13
         return (user_name);
14
 
14
 
Lines 20-26 Link Here
20
 
20
 
21
     if (pw != NULL) {
21
     if (pw != NULL) {
22
 	strncpy(user_name, pw->pw_name, 99);
22
 	strncpy(user_name, pw->pw_name, 99);
23
@@ -224,7 +229,11 @@
23
@@ -224,7 +229,11 @@ gamin_check_secure_dir(void)
24
 	free(dir);
24
 	free(dir);
25
 	return(0);
25
 	return(0);
26
     }
26
     }
Lines 32-38 Link Here
32
 	gam_error(DEBUG_INFO,
32
 	gam_error(DEBUG_INFO,
33
 		  "Socket directory %s has different owner\n",
33
 		  "Socket directory %s has different owner\n",
34
 		  dir);
34
 		  dir);
35
@@ -301,7 +310,11 @@
35
@@ -301,7 +310,11 @@ gamin_check_secure_path(const char *path
36
     if (ret < 0)
36
     if (ret < 0)
37
 	return(0);
37
 	return(0);
38
     
38
     
Lines 44-50 Link Here
44
 	gam_error(DEBUG_INFO,
44
 	gam_error(DEBUG_INFO,
45
 		  "Socket %s has different owner\n",
45
 		  "Socket %s has different owner\n",
46
 		  path);
46
 		  path);
47
@@ -428,10 +441,10 @@
47
@@ -428,10 +441,10 @@ gamin_write_credential_byte(int fd)
48
 {
48
 {
49
     char data[2] = { 0, 0 };
49
     char data[2] = { 0, 0 };
50
     int written;
50
     int written;
Lines 58-64 Link Here
58
     } cmsg;
58
     } cmsg;
59
     struct iovec iov;
59
     struct iovec iov;
60
     struct msghdr msg;
60
     struct msghdr msg;
61
@@ -443,16 +456,16 @@
61
@@ -443,16 +456,16 @@ gamin_write_credential_byte(int fd)
62
     msg.msg_iov = &iov;
62
     msg.msg_iov = &iov;
63
     msg.msg_iovlen = 1;
63
     msg.msg_iovlen = 1;
64
 
64
 
Lines 79-85 Link Here
79
     written = sendmsg(fd, &msg, 0);
79
     written = sendmsg(fd, &msg, 0);
80
 #else
80
 #else
81
     written = write(fd, &data[0], 1);
81
     written = write(fd, &data[0], 1);
82
@@ -654,15 +667,20 @@
82
@@ -654,15 +667,20 @@ gamin_check_cred(GAMDataPtr conn, int fd
83
     gid_t c_gid;
83
     gid_t c_gid;
84
 
84
 
85
 #ifdef HAVE_CMSGCRED
85
 #ifdef HAVE_CMSGCRED
Lines 103-109 Link Here
103
     /* Set the socket to receive credentials on the next message */
103
     /* Set the socket to receive credentials on the next message */
104
     {
104
     {
105
         int on = 1;
105
         int on = 1;
106
@@ -683,8 +701,8 @@
106
@@ -683,8 +701,8 @@ gamin_check_cred(GAMDataPtr conn, int fd
107
 
107
 
108
 #ifdef HAVE_CMSGCRED
108
 #ifdef HAVE_CMSGCRED
109
     memset(&cmsg, 0, sizeof(cmsg));
109
     memset(&cmsg, 0, sizeof(cmsg));
Lines 114-120 Link Here
114
 #endif
114
 #endif
115
 
115
 
116
 retry:
116
 retry:
117
@@ -701,7 +719,7 @@
117
@@ -701,7 +719,7 @@ retry:
118
         goto failed;
118
         goto failed;
119
     }
119
     }
120
 #ifdef HAVE_CMSGCRED
120
 #ifdef HAVE_CMSGCRED
Lines 123-129 Link Here
123
         GAM_DEBUG(DEBUG_INFO,
123
         GAM_DEBUG(DEBUG_INFO,
124
                   "Message from recvmsg() was not SCM_CREDS\n");
124
                   "Message from recvmsg() was not SCM_CREDS\n");
125
         goto failed;
125
         goto failed;
126
@@ -727,9 +745,10 @@
126
@@ -727,9 +745,10 @@ retry:
127
             goto failed;
127
             goto failed;
128
         }
128
         }
129
 #elif defined(HAVE_CMSGCRED)
129
 #elif defined(HAVE_CMSGCRED)
Lines 137-143 Link Here
137
 #else /* !SO_PEERCRED && !HAVE_CMSGCRED */
137
 #else /* !SO_PEERCRED && !HAVE_CMSGCRED */
138
         GAM_DEBUG(DEBUG_INFO,
138
         GAM_DEBUG(DEBUG_INFO,
139
                   "Socket credentials not supported on this OS\n");
139
                   "Socket credentials not supported on this OS\n");
140
@@ -1288,14 +1307,17 @@
140
@@ -1288,14 +1307,17 @@ FAMNextEvent(FAMConnection * fc, FAMEven
141
 
141
 
142
     // FIXME: drop and reacquire lock while blocked?
142
     // FIXME: drop and reacquire lock while blocked?
143
     gamin_data_lock(conn);
143
     gamin_data_lock(conn);
(-)files/patch-libgamin_gam__fork.c (-4 / +4 lines)
Lines 1-6 Link Here
1
--- libgamin/gam_fork.c.orig	2007-07-04 06:36:48.000000000 -0700
1
--- libgamin/gam_fork.c.orig	2007-07-04 13:36:48 UTC
2
+++ libgamin/gam_fork.c	2013-02-16 20:37:31.298176973 -0800
2
+++ libgamin/gam_fork.c
3
@@ -42,6 +42,78 @@
3
@@ -42,6 +42,78 @@ gamin_find_server_path(void)
4
     return NULL;
4
     return NULL;
5
 }
5
 }
6
 
6
 
Lines 79-85 Link Here
79
 /**
79
 /**
80
  * gamin_fork_server:
80
  * gamin_fork_server:
81
  * @fam_client_id: the client ID string to use
81
  * @fam_client_id: the client ID string to use
82
@@ -71,6 +143,13 @@
82
@@ -71,6 +143,13 @@ gamin_fork_server(const char *fam_client
83
         long open_max;
83
         long open_max;
84
 	long i;
84
 	long i;
85
 
85
 
(-)files/patch-libgamin_gam__fork.h (-3 / +3 lines)
Lines 1-6 Link Here
1
--- libgamin/gam_fork.h.orig	2007-07-04 06:36:48.000000000 -0700
1
--- libgamin/gam_fork.h.orig	2007-07-04 13:36:48 UTC
2
+++ libgamin/gam_fork.h	2013-02-16 20:38:00.328594608 -0800
2
+++ libgamin/gam_fork.h
3
@@ -32,6 +32,9 @@
3
@@ -32,6 +32,9 @@ extern "C" {
4
 #endif
4
 #endif
5
 
5
 
6
 int		gamin_fork_server	(const char *fam_client_id);
6
 int		gamin_fork_server	(const char *fam_client_id);
(-)files/patch-python_Makefile.in (-2 / +2 lines)
Lines 1-5 Link Here
1
--- python/Makefile.in.orig	2008-11-26 01:42:29.000000000 -0500
1
--- python/Makefile.in.orig	2008-11-24 15:25:07 UTC
2
+++ python/Makefile.in	2008-11-26 01:43:26.000000000 -0500
2
+++ python/Makefile.in
3
@@ -53,7 +53,7 @@ am__strip_dir = `echo $$p | sed -e 's|^.
3
@@ -53,7 +53,7 @@ am__strip_dir = `echo $$p | sed -e 's|^.
4
 am__installdirs = "$(DESTDIR)$(pythondir)" "$(DESTDIR)$(pythondir)"
4
 am__installdirs = "$(DESTDIR)$(pythondir)" "$(DESTDIR)$(pythondir)"
5
 pythonLTLIBRARIES_INSTALL = $(INSTALL)
5
 pythonLTLIBRARIES_INSTALL = $(INSTALL)
(-)files/patch-server__gam_node.h (-2 / +2 lines)
Lines 1-5 Link Here
1
--- server/gam_node.h.orig	2011-09-17 11:19:43.000000000 +0200
1
--- server/gam_node.h.orig	2007-07-04 13:36:49 UTC
2
+++ server/gam_node.h	2011-09-17 11:20:13.000000000 +0200
2
+++ server/gam_node.h
3
@@ -58,7 +58,7 @@ gboolean              gam_node_is_dir   
3
@@ -58,7 +58,7 @@ gboolean              gam_node_is_dir   
4
 void                  gam_node_set_is_dir          (GamNode         *node,
4
 void                  gam_node_set_is_dir          (GamNode         *node,
5
 						   gboolean        is_dir);
5
 						   gboolean        is_dir);
(-)files/patch-server__gam_subscription.c (-2 / +2 lines)
Lines 1-5 Link Here
1
--- server/gam_subscription.c.orig	2011-09-17 11:17:22.000000000 +0200
1
--- server/gam_subscription.c.orig	2007-07-04 13:36:49 UTC
2
+++ server/gam_subscription.c	2011-09-17 11:17:44.000000000 +0200
2
+++ server/gam_subscription.c
3
@@ -141,7 +141,7 @@ gam_subscription_pathlen(GamSubscription
3
@@ -141,7 +141,7 @@ gam_subscription_pathlen(GamSubscription
4
  * @param sub the GamSubscription
4
  * @param sub the GamSubscription
5
  * @returns The path being monitored.  It should not be freed.
5
  * @returns The path being monitored.  It should not be freed.
(-)files/patch-server__gam_subscription.h (-2 / +2 lines)
Lines 1-5 Link Here
1
--- server/gam_subscription.h.orig	2011-09-17 11:15:00.000000000 +0200
1
--- server/gam_subscription.h.orig	2007-07-04 13:36:49 UTC
2
+++ server/gam_subscription.h	2011-09-17 11:15:18.000000000 +0200
2
+++ server/gam_subscription.h
3
@@ -21,7 +21,7 @@ int                  gam_subscription_pa
3
@@ -21,7 +21,7 @@ int                  gam_subscription_pa
4
 
4
 
5
 int                  gam_subscription_get_reqno    (GamSubscription *sub);
5
 int                  gam_subscription_get_reqno    (GamSubscription *sub);
(-)files/patch-server_gam__channel.c (-6 / +7 lines)
Lines 1-5 Link Here
1
--- server/gam_channel.c.orig	Tue Aug  9 12:17:39 2005
1
--- server/gam_channel.c.orig	2007-07-04 13:36:49 UTC
2
+++ server/gam_channel.c	Fri Feb 10 01:22:46 2006
2
+++ server/gam_channel.c
3
@@ -7,6 +7,7 @@
3
@@ -7,6 +7,7 @@
4
 #include <sys/stat.h>
4
 #include <sys/stat.h>
5
 #include <sys/un.h>
5
 #include <sys/un.h>
Lines 97-103 Link Here
97
 #else /* !SO_PEERCRED && !HAVE_CMSGCRED */
97
 #else /* !SO_PEERCRED && !HAVE_CMSGCRED */
98
         GAM_DEBUG(DEBUG_INFO,
98
         GAM_DEBUG(DEBUG_INFO,
99
                   "Socket credentials not supported on this OS\n");
99
                   "Socket credentials not supported on this OS\n");
100
@@ -620,6 +621,7 @@ gam_listen_unix_socket(const char *path)
100
@@ -620,6 +623,7 @@ gam_listen_unix_socket(const char *path)
101
 {
101
 {
102
     int fd;
102
     int fd;
103
     struct sockaddr_un addr;
103
     struct sockaddr_un addr;
Lines 105-111 Link Here
105
 
105
 
106
     fd = socket(PF_UNIX, SOCK_STREAM, 0);
106
     fd = socket(PF_UNIX, SOCK_STREAM, 0);
107
     if (fd < 0) {
107
     if (fd < 0) {
108
@@ -640,8 +642,18 @@ gam_listen_unix_socket(const char *path)
108
@@ -640,9 +644,19 @@ gam_listen_unix_socket(const char *path)
109
      * some extra protection checks. Also make sure the socket is created
109
      * some extra protection checks. Also make sure the socket is created
110
      * with restricted mode
110
      * with restricted mode
111
      */
111
      */
Lines 113-119 Link Here
113
+    if (!gam_check_secure_dir()) {
113
+    if (!gam_check_secure_dir()) {
114
+	close(fd);
114
+	close(fd);
115
 	return (-1);
115
 	return (-1);
116
+    }
116
     }
117
+
117
+
118
+    if (stat(path, &st) == 0) {
118
+    if (stat(path, &st) == 0) {
119
+        /* bind() will fail if the socket already exists */
119
+        /* bind() will fail if the socket already exists */
Lines 122-127 Link Here
122
+            close(fd);
122
+            close(fd);
123
+            return (-1);
123
+            return (-1);
124
+        }
124
+        }
125
     }
125
+    }
126
     strncpy(&addr.sun_path[0], path, (sizeof(addr) - 4) - 1);
126
     strncpy(&addr.sun_path[0], path, (sizeof(addr) - 4) - 1);
127
     umask(0077);
127
     umask(0077);
128
 #endif
(-)files/patch-server_gam__eq.c (-2 / +2 lines)
Lines 1-5 Link Here
1
--- server/gam_eq.c.orig	2012-05-13 19:42:20.257794534 +0400
1
--- server/gam_eq.c.orig	2007-07-04 13:36:49 UTC
2
+++ server/gam_eq.c	2012-05-13 19:44:41.228799909 +0400
2
+++ server/gam_eq.c
3
@@ -124,7 +124,7 @@ gam_eq_flush (gam_eq_t *eq, GamConnDataP
3
@@ -124,7 +124,7 @@ gam_eq_flush (gam_eq_t *eq, GamConnDataP
4
 {
4
 {
5
 	gboolean done_work = FALSE;
5
 	gboolean done_work = FALSE;
(-)files/patch-server_gam__fs.c (-2 / +2 lines)
Lines 1-5 Link Here
1
--- server/gam_fs.c.orig	2007-07-04 09:36:49.000000000 -0400
1
--- server/gam_fs.c.orig	2008-11-12 20:45:28 UTC
2
+++ server/gam_fs.c	2007-08-10 15:05:41.000000000 -0400
2
+++ server/gam_fs.c
3
@@ -7,6 +7,11 @@
3
@@ -7,6 +7,11 @@
4
 #include <string.h>
4
 #include <string.h>
5
 #include <errno.h>
5
 #include <errno.h>
(-)files/patch-server_gam__kqueue.c (-2 / +2 lines)
Lines 1-5 Link Here
1
--- server/gam_kqueue.c.orig	2007-07-04 09:50:41.000000000 -0400
1
--- server/gam_kqueue.c.orig	2007-07-04 13:50:41 UTC
2
+++ server/gam_kqueue.c	2009-06-03 13:43:38.000000000 -0400
2
+++ server/gam_kqueue.c
3
@@ -5,7 +5,8 @@
3
@@ -5,7 +5,8 @@
4
  *
4
  *
5
  *     * http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=bks&fname=/SGI_Developer/books/IIDsktp_IG/sgi_html/ch08.html
5
  *     * http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=bks&fname=/SGI_Developer/books/IIDsktp_IG/sgi_html/ch08.html
(-)files/patch-server_gam__node.c (-2 / +2 lines)
Lines 1-5 Link Here
1
--- server/gam_node.c.orig	2007-07-04 15:36:49.000000000 +0200
1
--- server/gam_node.c.orig	2007-07-04 13:36:49 UTC
2
+++ server/gam_node.c	2011-09-17 11:19:10.000000000 +0200
2
+++ server/gam_node.c
3
@@ -23,6 +23,7 @@
3
@@ -23,6 +23,7 @@
4
 #include "gam_event.h"
4
 #include "gam_event.h"
5
 #include "gam_node.h"
5
 #include "gam_node.h"
(-)files/patch-server_gam__poll__basic.c (-2 / +2 lines)
Lines 1-5 Link Here
1
--- server/gam_poll_basic.c.orig	2007-08-10 15:12:29.000000000 -0400
1
--- server/gam_poll_basic.c.orig	2007-07-04 13:46:29 UTC
2
+++ server/gam_poll_basic.c	2007-08-10 15:16:07.000000000 -0400
2
+++ server/gam_poll_basic.c
3
@@ -345,7 +345,7 @@ gam_poll_basic_poll_file(GamNode * node)
3
@@ -345,7 +345,7 @@ gam_poll_basic_poll_file(GamNode * node)
4
 #ifdef ST_MTIM_NSEC
4
 #ifdef ST_MTIM_NSEC
5
 		GAM_DEBUG(DEBUG_INFO, "%d %d : %d %d\n", node->sbuf.st_mtim.tv_sec, node->sbuf.st_mtim.tv_nsec, sbuf.st_mtim.tv_sec, sbuf.st_mtim.tv_nsec);
5
 		GAM_DEBUG(DEBUG_INFO, "%d %d : %d %d\n", node->sbuf.st_mtim.tv_sec, node->sbuf.st_mtim.tv_nsec, sbuf.st_mtim.tv_sec, sbuf.st_mtim.tv_nsec);
(-)files/patch-server_gam__server.c (-2 / +2 lines)
Lines 1-5 Link Here
1
--- server/gam_server.c.orig	2007-07-04 09:36:49.000000000 -0400
1
--- server/gam_server.c.orig	2007-07-04 13:36:49 UTC
2
+++ server/gam_server.c	2009-05-01 20:25:41.000000000 -0400
2
+++ server/gam_server.c
3
@@ -32,7 +32,7 @@
3
@@ -32,7 +32,7 @@
4
 #include "gam_server.h"
4
 #include "gam_server.h"
5
 #include "gam_channel.h"
5
 #include "gam_channel.h"
(-)files/patch-tests_testing.c (-2 / +2 lines)
Lines 1-5 Link Here
1
--- tests/testing.c.orig	Thu Oct 27 10:51:03 2005
1
--- tests/testing.c.orig	2007-07-04 13:36:49 UTC
2
+++ tests/testing.c	Tue Feb 14 17:46:01 2006
2
+++ tests/testing.c
3
@@ -376,11 +376,11 @@ processCommand(char *line, int no)
3
@@ -376,11 +376,11 @@ processCommand(char *line, int no)
4
         }
4
         }
5
         printf("chmod %s to %s\n", arg, arg2);
5
         printf("chmod %s to %s\n", arg, arg2);

Return to bug 256896