Bug 96295 - shells/scponly cannot work with rsync
Summary: shells/scponly cannot work with rsync
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Hideyuki KURASHINA
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-25 02:40 UTC by UEDA Hiroyuki
Modified: 2006-08-06 18:39 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description UEDA Hiroyuki 2006-04-25 02:40:10 UTC
shells/scponly cannot work with rsync command correctly even if we build it using WITH_SCPONLY_RSYNC=yes. Following logs are recorded.

-----
Jan 10 13:12:55 firebomber scponly[3479]: option e is not permitted for use with /usr/local/bin/rsync(arg was rver) (username: scponly(5009), IP/port: ::1 50657 22))
Jan 10 13:12:55 firebomber scponly[3479]: requested command (/usr/local/bin/rsync --server -vlogDtprz . incoming) tried to use disallowed argument (username: scponly(5009), IP/port: ::1 50657 22))
-----

Fix: 

Probably following patch will solve this problem.

https://lists.ccs.neu.edu/pipermail/scponly/2006-March/001287.html

NOTICE: This is for scponly-4.6.
How-To-Repeat: # cd /usr/ports/shells/scponly
# make install WITH_SCPONLY_RSYNC=yes
..
% rsync -avz ... with user which login shell is scponly.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2006-04-25 02:44:11 UTC
Responsible Changed
From-To: freebsd-ports-bugs->rushani

Over to maintainer
Comment 2 Hideyuki KURASHINA freebsd_committer freebsd_triage 2006-05-09 16:34:09 UTC
Hi,

I've confirmed the rsync compatibility in scponly 4.4 is broken.
Unfortunately, at this moment I don't have enough time to
test the patch you showed us...

Edwin, could you please commit following patch to mark this port
broken if it will be built with WITH_SCPONLY_RSYNC knob?

Regards,

-- rushani

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/shells/scponly/Makefile,v
retrieving revision 1.22
diff -u -r1.22 Makefile
--- Makefile	31 Jan 2006 14:05:46 -0000	1.22
+++ Makefile	9 May 2006 15:13:34 -0000
@@ -106,6 +106,7 @@
 .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
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2006-05-09 21:53:43 UTC
State Changed
From-To: open->suspended

Suspend on maintainers request.
Comment 4 edwin 2006-05-09 21:54:35 UTC
On Wed, May 10, 2006 at 12:34:09AM +0900, Hideyuki KURASHINA wrote:
> Edwin, could you please commit following patch to mark this port
> broken if it will be built with WITH_SCPONLY_RSYNC knob?

Done

-- 
Edwin Groothuis      |            Personal website: http://www.mavetju.org
edwin@mavetju.org    |          Weblog: http://weblog.barnet.com.au/edwin/
Comment 5 Hideyuki KURASHINA freebsd_committer freebsd_triage 2006-06-03 04:31:32 UTC
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
+ 				 */
Comment 6 Hideyuki KURASHINA freebsd_committer freebsd_triage 2006-06-03 04:34:02 UTC
>>> On Sat, 03 Jun 2006 12:31:32 +0900 (JST), Hideyuki KURASHINA <rushani@FreeBSD.org> said:

> Uesa-san, apology for my late response...  I confirmed the patch
    ^
Sorry, I mean Ue*d*a-san of course.

-- rushani
Comment 7 Edwin Groothuis freebsd_committer freebsd_triage 2006-06-03 08:45:56 UTC
State Changed
From-To: suspended->open

maintainer approved
Comment 8 UEDA Hiroyuki 2006-06-03 11:47:43 UTC
Dear great FreeBSD committers.


> > Uesa-san, apology for my late response...  I confirmed the patch
>     ^
> Sorry, I mean Ue*d*a-san of course.

Of course, I don't mind :).

Thanks for your confirmation of my send-PR and working for it. We are
very happy because we do not need to patch manually.


Best regards.

-----
UEDA Hiroyuki <ueda@drweb.jp>
Netforest Inc., JAPAN
Comment 9 Tilman Keskinoz freebsd_committer freebsd_triage 2006-08-06 18:38:29 UTC
State Changed
From-To: open->closed

Committed, thanks.