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

(-)fcron/Makefile (-1 / +8 lines)
Lines 8-13 Link Here
8
8
9
PORTNAME=	fcron
9
PORTNAME=	fcron
10
PORTVERSION=	3.0.1
10
PORTVERSION=	3.0.1
11
PORTREVISION=	1
11
CATEGORIES=	sysutils
12
CATEGORIES=	sysutils
12
MASTER_SITES=	${MASTER_SITE_SUNSITE} \
13
MASTER_SITES=	${MASTER_SITE_SUNSITE} \
13
		http://fcron.free.fr/archives/ \
14
		http://fcron.free.fr/archives/ \
Lines 20-29 Link Here
20
21
21
GNU_CONFIGURE=	yes
22
GNU_CONFIGURE=	yes
22
USE_GMAKE=	yes
23
USE_GMAKE=	yes
24
USE_AUTOTOOLS=	autoconf:259
23
USE_PERL5_BUILD=yes
25
USE_PERL5_BUILD=yes
24
CONFIGURE_ARGS=	--with-etcdir=${PREFIX}/etc --with-cflags="${CFLAGS}" \
26
CONFIGURE_ARGS=	--with-etcdir=${PREFIX}/etc --with-cflags="${CFLAGS}" \
25
		--with-rootname=root --with-rootgroup=wheel \
27
		--with-rootname=root --with-rootgroup=wheel \
26
		--with-docdir=${DOCSDIR}
28
		--with-docdir=${DOCSDIR} --with-debug
27
29
28
WRKSRC=		${WRKDIR}/fcron-${PORTVERSION}
30
WRKSRC=		${WRKDIR}/fcron-${PORTVERSION}
29
31
Lines 34-39 Link Here
34
MAN5=		fcron.conf.5 fcrontab.5
36
MAN5=		fcron.conf.5 fcrontab.5
35
MAN8=		fcron.8
37
MAN8=		fcron.8
36
38
39
PAMDIR?=	/etc/pam.d
40
PLIST_SUB+=	PAMDIR=${PAMDIR}
41
37
PORTDOCS=	*
42
PORTDOCS=	*
38
43
39
.if defined(MANLANG) && exists(${WRKSRC}/doc/${MANLANG})
44
.if defined(MANLANG) && exists(${WRKSRC}/doc/${MANLANG})
Lines 55-60 Link Here
55
.endfor
60
.endfor
56
	${MKDIR} ${EXAMPLESDIR}
61
	${MKDIR} ${EXAMPLESDIR}
57
	${INSTALL_DATA} ${FILESDIR}/fcrontab-* ${WRKSRC}/files/*.pam ${EXAMPLESDIR}
62
	${INSTALL_DATA} ${FILESDIR}/fcrontab-* ${WRKSRC}/files/*.pam ${EXAMPLESDIR}
63
	[ -f ${PAMDIR}/fcron ] || ${INSTALL_DATA} ${WRKSRC}/files/fcron.pam ${PAMDIR}/fcron
64
	[ -f ${PAMDIR}/fcrontab ] || ${INSTALL_DATA} ${WRKSRC}/files/fcrontab.pam ${PAMDIR}/fcrontab
58
.for n in 1 5 8
65
.for n in 1 5 8
59
	${INSTALL_MAN} ${MAN${n}:S|^|${DOCSRC}/man/|} ${PREFIX}/man/man${n}
66
	${INSTALL_MAN} ${MAN${n}:S|^|${DOCSRC}/man/|} ${PREFIX}/man/man${n}
60
.endfor
67
.endfor
(-)fcron/files/patch-config.h.in (+8 lines)
Line 0 Link Here
1
--- config.h.in.orig	Mon Feb  6 14:44:52 2006
2
+++ config.h.in	Tue May  9 17:15:19 2006
3
@@ -424,3 +424,5 @@
4
 #define O_SYNC O_FSYNC
5
 #endif
6
 
7
+/* Define if (struct sockaddr) has an sa_len field.  */
8
+#undef HAVE_SA_LEN
(-)fcron/files/patch-configure.in (+20 lines)
Line 0 Link Here
1
--- configure.in.orig	Mon Jan  9 17:21:24 2006
2
+++ configure.in	Tue May  9 17:04:30 2006
3
@@ -57,6 +57,17 @@
4
 AC_STRUCT_TM
5
 AC_TYPE_UID_T
6
 
7
+dnl Check for post-Reno style struct sockaddr
8
+AC_CACHE_CHECK([for sa_len],
9
+  ac_cv_sa_len,
10
+[AC_TRY_COMPILE([#include <sys/types.h>
11
+#include <sys/socket.h>], [int main(void) {
12
+ struct sockaddr t;t.sa_len = 0;}],
13
+  ac_cv_sa_len=yes,ac_cv_sa_len=no)])
14
+if test $ac_cv_sa_len = yes; then
15
+  AC_DEFINE(HAVE_SA_LEN)
16
+fi
17
+
18
 dnl Checks for library functions.
19
 AC_PROG_GCC_TRADITIONAL
20
 AC_FUNC_MEMCMP
(-)fcron/files/patch-fcrondyn.c (+29 lines)
Line 0 Link Here
1
--- fcrondyn.c.orig	Mon Feb  6 14:44:52 2006
2
+++ fcrondyn.c	Tue May  9 15:24:22 2006
3
@@ -399,17 +399,21 @@
4
     int fd = -1;
5
     struct sockaddr_un addr;
6
     int len = 0;
7
+    int sa_len;
8
 
9
     if ( (fd = socket(PF_UNIX, SOCK_STREAM, 0)) == -1 )
10
 	die_e("could not create socket");
11
 
12
     addr.sun_family = AF_UNIX;
13
-    if ( (len = strlen(fifofile)) > sizeof(addr.sun_path) )
14
-	die("Error : fifo file path too long (max is %d)", sizeof(addr.sun_path));
15
-    strncpy(addr.sun_path, fifofile, sizeof(addr.sun_path) - 1);
16
-    addr.sun_path[sizeof(addr.sun_path)-1] = '\0';
17
+    if ( (len = strlen(fifofile)) > sizeof(addr.sun_path) - 1 )
18
+	die("Error : fifo file path too long (max is %d)", sizeof(addr.sun_path) - 1);
19
+    strncpy(addr.sun_path, fifofile, sizeof(addr.sun_path));
20
+    sa_len = (addr.sun_path - (char *)&addr) + len;
21
+#if HAVE_SA_LEN
22
+    addr.sun_len = sa_len;
23
+#endif
24
 
25
-    if ( connect(fd, (struct sockaddr *) &addr, sizeof(addr.sun_family) + len) < 0 )
26
+    if ( connect(fd, (struct sockaddr *) &addr, sa_len) < 0 )
27
 	die_e("Cannot connect() to fcron (check if fcron is running)");
28
 
29
     if ( authenticate_user(fd) == ERR ) {
(-)fcron/files/patch-socket.c (+34 lines)
Line 0 Link Here
1
--- socket.c.orig	Mon Feb  6 14:44:52 2006
2
+++ socket.c	Tue May  9 16:33:19 2006
3
@@ -134,6 +134,7 @@
4
 {
5
     struct sockaddr_un addr;
6
     int len = 0;
7
+    int sa_len;
8
 
9
     /* used in fcron.c:main_loop():select() */
10
     FD_ZERO(&read_set);
11
@@ -145,15 +146,19 @@
12
     }
13
 
14
     addr.sun_family = AF_UNIX;
15
-    if ( (len = strlen(fifofile)) > sizeof(addr.sun_path) ) {
16
-	error("Error : fifo file path too long (max is %d)", sizeof(addr.sun_path));
17
+    if ( (len = strlen(fifofile)) > sizeof(addr.sun_path) - 1) {
18
+	error("Error : fifo file path too long (max is %d)", sizeof(addr.sun_path) - 1);
19
 	goto err;
20
     }
21
-    strncpy(addr.sun_path, fifofile, sizeof(addr.sun_path) - 1);
22
+    strncpy(addr.sun_path, fifofile, sizeof(addr.sun_path));
23
     addr.sun_path[sizeof(addr.sun_path) -1 ] = '\0';
24
+    sa_len = (addr.sun_path - (char *)&addr) + len;
25
+#if HAVE_SA_LEN
26
+    addr.sun_len = sa_len;
27
+#endif
28
 
29
     unlink(fifofile);
30
-    if (bind(listen_fd, (struct sockaddr*) &addr, sizeof(addr.sun_family)+len+1) != 0){
31
+    if (bind(listen_fd, (struct sockaddr*) &addr, sa_len) != 0){
32
 	error_e("Cannot bind socket to '%s'", fifofile);
33
 	goto err;
34
     }
(-)fcron/files/pkg-message.in (-6 lines)
Lines 5-16 Link Here
5
	fcron_enable="YES"
5
	fcron_enable="YES"
6
	cron_enable="NO"
6
	cron_enable="NO"
7
7
8
install the pam config files
9
10
	mkdir -p %%PREFIX%%/etc/pam.d
11
	cp %%EXAMPLESDIR%%/fcron.pam %%PREFIX%%/etc/pam.d/fcron
12
	cp %%EXAMPLESDIR%%/fcrontab.pam %%PREFIX%%/etc/pam.d/fcrontab
13
14
and move any jobs in /etc/crontab to the root fcrontab(5) file. See:
8
and move any jobs in /etc/crontab to the root fcrontab(5) file. See:
15
9
16
%%EXAMPLESDIR%%
10
%%EXAMPLESDIR%%
(-)fcron/pkg-plist (-2 / +2 lines)
Lines 5-12 Link Here
5
etc/fcron.conf.dist
5
etc/fcron.conf.dist
6
etc/fcron.deny.dist
6
etc/fcron.deny.dist
7
sbin/fcron
7
sbin/fcron
8
%%EXAMPLESDIR%%/fcron.pam
8
%%PAMDIR%%/fcron
9
%%PAMDIR%%/fcrontab
9
%%EXAMPLESDIR%%/fcrontab-operator
10
%%EXAMPLESDIR%%/fcrontab-operator
10
%%EXAMPLESDIR%%/fcrontab-root
11
%%EXAMPLESDIR%%/fcrontab-root
11
%%EXAMPLESDIR%%/fcrontab.pam
12
@dirrm %%EXAMPLESDIR%%
12
@dirrm %%EXAMPLESDIR%%

Return to bug 97066