Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 May 2006 23:30:22 GMT
From:      Brad Huntting <huntting@glarp.com>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/96918: sysutils/fcron: fcrondyn completely broken 
Message-ID:  <200605082330.k48NUMH2058541@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/96918; it has been noted by GNATS.

From: Brad Huntting <huntting@glarp.com>
To: Edwin Groothuis <edwin@FreeBSD.org>
Cc: huntting@glarp.com
Subject: Re: ports/96918: sysutils/fcron: fcrondyn completely broken 
Date: Mon, 08 May 2006 09:34:51 -0600

 Please let me know how the attached patch works.
 
 	cd /tmp;
 	cp -r /usr/ports/sysutils/fcron .
 	patch </tmp/attached_patch
 
 If you dont see any other problems, I'll submit it to the ports-meister.
 
 
 thanx,
 brad
 
 ----------- cut here -------------
 diff -Nru /usr/ports/sysutils/fcron/Makefile fcron/Makefile
 --- /usr/ports/sysutils/fcron/Makefile	Fri Feb 10 02:51:04 2006
 +++ fcron/Makefile	Sun May  7 19:10:30 2006
 @@ -8,6 +8,7 @@
  
  PORTNAME=	fcron
  PORTVERSION=	3.0.1
 +PORTREVISION=	1
  CATEGORIES=	sysutils
  MASTER_SITES=	${MASTER_SITE_SUNSITE} \
  		http://fcron.free.fr/archives/ \
 @@ -34,6 +35,8 @@
  MAN5=		fcron.conf.5 fcrontab.5
  MAN8=		fcron.8
  
 +PAM_DIR?=	/etc/pam.d
 +
  PORTDOCS=	*
  
  .if defined(MANLANG) && exists(${WRKSRC}/doc/${MANLANG})
 @@ -55,6 +58,8 @@
  .endfor
  	${MKDIR} ${EXAMPLESDIR}
  	${INSTALL_DATA} ${FILESDIR}/fcrontab-* ${WRKSRC}/files/*.pam ${EXAMPLESDIR}
 +	[ -f ${PAM_DIR}/fcron ] || ${INSTALL_DATA} ${WRKSRC}/files/fcron.pam ${PAM_DIR}/fcron
 +	[ -f ${PAM_DIR}/fcrontab ] || ${INSTALL_DATA} ${WRKSRC}/files/fcrontab.pam ${PAM_DIR}/fcrontab
  .for n in 1 5 8
  	${INSTALL_MAN} ${MAN${n}:S|^|${DOCSRC}/man/|} ${PREFIX}/man/man${n}
  .endfor
 diff -Nru /usr/ports/sysutils/fcron/files/patch-fcrondyn.c fcron/files/patch-fcrondyn.c
 --- /usr/ports/sysutils/fcron/files/patch-fcrondyn.c	Wed Dec 31 17:00:00 1969
 +++ fcron/files/patch-fcrondyn.c	Sun May  7 19:05:18 2006
 @@ -0,0 +1,40 @@
 +--- fcrondyn.c.orig	Mon Feb  6 14:44:52 2006
 ++++ fcrondyn.c	Sun May  7 19:04:07 2006
 +@@ -35,6 +35,10 @@
 + #include "allow.h"
 + #include "read_string.h"
 + 
 ++#if (defined(__unix__) || defined(unix)) && !defined(USG)
 ++#include <sys/param.h>
 ++#endif
 ++
 + char rcs_info[] = "$Id: fcrondyn.c,v 1.14 2006/01/11 00:48:33 thib Exp thib $";
 + 
 + void info(void);
 +@@ -399,17 +403,21 @@
 +     int fd = -1;
 +     struct sockaddr_un addr;
 +     int len = 0;
 ++    int sa_len;
 + 
 +     if ( (fd = socket(PF_UNIX, SOCK_STREAM, 0)) == -1 )
 + 	die_e("could not create socket");
 + 
 +     addr.sun_family = AF_UNIX;
 +-    if ( (len = strlen(fifofile)) > sizeof(addr.sun_path) )
 +-	die("Error : fifo file path too long (max is %d)", sizeof(addr.sun_path));
 +-    strncpy(addr.sun_path, fifofile, sizeof(addr.sun_path) - 1);
 +-    addr.sun_path[sizeof(addr.sun_path)-1] = '\0';
 ++    if ( (len = strlen(fifofile)) > sizeof(addr.sun_path) - 1 )
 ++	die("Error : fifo file path too long (max is %d)", sizeof(addr.sun_path) - 1);
 ++    strncpy(addr.sun_path, fifofile, sizeof(addr.sun_path));
 ++    sa_len = (addr.sun_path - (char *)&addr) + len;
 ++#if (defined(BSD) && (BSD >= 199103)) /* 4.3BSD Net2 */
 ++    addr.sun_len = sa_len;
 ++#endif
 + 
 +-    if ( connect(fd, (struct sockaddr *) &addr, sizeof(addr.sun_family) + len) < 0 )
 ++    if ( connect(fd, (struct sockaddr *) &addr, sa_len) < 0 )
 + 	die_e("Cannot connect() to fcron (check if fcron is running)");
 + 
 +     if ( authenticate_user(fd) == ERR ) {
 diff -Nru /usr/ports/sysutils/fcron/files/pkg-message.in fcron/files/pkg-message.in
 --- /usr/ports/sysutils/fcron/files/pkg-message.in	Fri Feb 10 02:51:04 2006
 +++ fcron/files/pkg-message.in	Mon May  8 09:24:35 2006
 @@ -5,12 +5,6 @@
  	fcron_enable="YES"
  	cron_enable="NO"
  
 -install the pam config files
 -
 -	mkdir -p %%PREFIX%%/etc/pam.d
 -	cp %%EXAMPLESDIR%%/fcron.pam %%PREFIX%%/etc/pam.d/fcron
 -	cp %%EXAMPLESDIR%%/fcrontab.pam %%PREFIX%%/etc/pam.d/fcrontab
 -
  and move any jobs in /etc/crontab to the root fcrontab(5) file. See:
  
  %%EXAMPLESDIR%%
 diff -Nru /usr/ports/sysutils/fcron/pkg-plist fcron/pkg-plist
 --- /usr/ports/sysutils/fcron/pkg-plist	Fri Feb 10 02:51:04 2006
 +++ fcron/pkg-plist	Sun May  7 11:04:50 2006
 @@ -5,8 +5,8 @@
  etc/fcron.conf.dist
  etc/fcron.deny.dist
  sbin/fcron
 -%%EXAMPLESDIR%%/fcron.pam
 +%%PAMDIR%%/fcron
 +%%PAMDIR%%/fcrontab
  %%EXAMPLESDIR%%/fcrontab-operator
  %%EXAMPLESDIR%%/fcrontab-root
 -%%EXAMPLESDIR%%/fcrontab.pam
  @dirrm %%EXAMPLESDIR%%
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605082330.k48NUMH2058541>