Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 03 Jun 2006 12:31:32 +0900 (JST)
From:      Hideyuki KURASHINA <rushani@FreeBSD.org>
To:        ueda@drweb.jp
Cc:        freebsd-ports-bugs@FreeBSD.org, edwin@mavetju.org, FreeBSD-gnats-submit@FreeBSD.org, ""@FreeBSD.org
Subject:   Re: ports/96295: shells/scponly cannot work with rsync
Message-ID:  <20060603.123132.104029872.rushani@FreeBSD.org>
In-Reply-To: <20060509205435.GB1116@k7.mavetju>
References:  <200604250144.k3P1iEGF098700@freefall.freebsd.org> <20060510.003409.74730619.rushani@FreeBSD.org> <20060509205435.GB1116@k7.mavetju>

next in thread | previous in thread | raw e-mail | index | archive | help
Uesa-san, apology for my late response...  I confirmed the patch
you suggested fixes the problem.

Edwin or any other committers, could you please commit attached patch?
The Commit log candidate is below:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Unbreak rsync comatibility when long opts ("--server", "--sender"
and "--delete" in this case) specified.

Suggested by:	ueda _at_ drweb dot jp
Obtained from:	https://lists.ccs.neu.edu/pipermail/scponly/2006-March/001287.html
PR:		ports/96295
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-- rushani (as port maintainer of scponly)

Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/shells/scponly/Makefile,v
retrieving revision 1.24
diff -u -r1.24 Makefile
--- Makefile	3 Jun 2006 02:59:04 -0000	1.24
+++ Makefile	3 Jun 2006 03:23:23 -0000
@@ -71,6 +71,7 @@
 
 PORTNAME=	scponly
 PORTVERSION=	4.6
+PORTREVISION=	1
 CATEGORIES=	shells
 MASTER_SITES=	http://www.sublimation.org/scponly/ \
 		${MASTER_SITE_SOURCEFORGE}
@@ -85,6 +86,8 @@
 GNU_CONFIGURE=	yes
 PLIST_SUB+=	SCPONLY_CHROOT="@comment "
 
+PATCH_STRIP=	-p1
+
 .include <bsd.port.pre.mk>
 
 .if defined(SCPONLY_DEFAULT_CHDIR) && !empty(SCPONLY_DEFAULT_CHDIR)
@@ -105,7 +108,6 @@
 .endif
 
 .if defined(WITH_SCPONLY_RSYNC)
-BROKEN=		The Rsync compatibility is broken
 BUILD_DEPENDS+=	rsync:${PORTSDIR}/net/rsync
 RUN_DEPENDS+=	${BUILD_DEPENDS}
 CONFIGURE_ARGS+=--enable-rsync-compat
Index: files/patch-ae
===================================================================
RCS file: files/patch-ae
diff -N files/patch-ae
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-ae	3 Jun 2006 03:23:23 -0000
@@ -0,0 +1,97 @@
+--- scponly-4.6/helper.c.orig	Tue Jan 31 22:04:16 2006
++++ scponly-4.6/helper.c	Thu Mar 23 00:53:01 2006
+@@ -133,6 +133,78 @@
+ 	char		**tmpptr=av;
+ 	int			ch;
+ 	int			ac=0;
++	char		**av2 = NULL;
++
++	/*	
++	 *	first count the arguments in the vector
++	 */
++	tmpptr=av;
++	while (*tmpptr!=NULL)
++	{	
++		*tmpptr++;
++		ac++;
++	}
++
++#ifdef PROG_RSYNC
++	if (exact_match(PROG_RSYNC, av[0]))
++	{
++		/*
++		 *	these are the long opts (beginning "--") which we
++		 *	allow for rsync
++		 */
++		char *permitted_long_opts[] = {
++				"--server",
++				"--sender",
++				"--delete",
++				NULL	/* last element must be NULL */
++			};
++
++		/*
++		 *	make a copy of the args excluding any permitted long
++		 *	options
++		 */
++		int i, j;
++		av2 = malloc(ac * sizeof *av2);
++		av2[0] = av[0];
++		for (i = 1, j = 1; i < ac; ++i)
++		{
++			if (0 == strncmp(av[i], "--", 2))
++			{
++				char **p;
++				/*
++				 *	test against permitted opts
++				 */
++				for (p = permitted_long_opts; *p; ++p)
++				{
++					if (exact_match(av[i], *p))
++						break;
++				}
++				
++				if (*p)
++				{
++					/*
++					 *	permitted; skip this one
++					 */
++					continue;
++				}
++				else
++				{
++					/*
++					 *	no match
++					 */
++					syslog(LOG_ERR, "option %s is not permitted for use with %s (%s)",
++						av[i], cmdarg->name, logstamp());
++					return 1;
++				}
++			}
++			av2[j++] = av[i];
++			    
++		}
++		av2[j] = NULL;
++		ac = j;
++		av = av2;
++	}
++#endif /* PROG_RSYNC */
+ 
+ 	while (cmdarg != NULL)
+ 	{
+@@ -151,15 +223,6 @@
+ 			 */
+ 			if (1 == cmdarg->getoptflag)
+ 			{
+-				/*	
+-				 *	first count the arguments in the vector
+-				 */
+-				tmpptr=av;
+-				while (*tmpptr!=NULL)
+-				{	
+-					*tmpptr++;
+-					ac++;
+-				}
+ 				/* 
+ 				 *	now use getopt to look for our problem option
+ 				 */



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