From nobody@FreeBSD.org  Tue Apr 25 01:33:00 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id DAAAD16A401
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 25 Apr 2006 01:33:00 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id AA1A243D45
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 25 Apr 2006 01:33:00 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k3P1X09l017136
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 25 Apr 2006 01:33:00 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k3P1X0JE017135;
	Tue, 25 Apr 2006 01:33:00 GMT
	(envelope-from nobody)
Message-Id: <200604250133.k3P1X0JE017135@www.freebsd.org>
Date: Tue, 25 Apr 2006 01:33:00 GMT
From: UEDA Hiroyuki <ueda@drweb.jp>
To: freebsd-gnats-submit@FreeBSD.org
Subject: shells/scponly cannot work with rsync
X-Send-Pr-Version: www-2.3

>Number:         96295
>Category:       ports
>Synopsis:       shells/scponly cannot work with rsync
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    rushani
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 25 01:40:10 GMT 2006
>Closed-Date:    Sun Aug 06 17:39:34 GMT 2006
>Last-Modified:  Sun Aug 06 17:39:34 GMT 2006
>Originator:     UEDA Hiroyuki
>Release:        FreeBSD 6.1-RC
>Organization:
Netforest Inc.
>Environment:
FreeBSD fb5-stable.netforest.co.jp 6.1-RC FreeBSD 6.1-RC #13: Wed Apr 12 11:40:36 JST 2006     root@fb5-stable.netforest.co.jp:/usr/obj/usr/src/sys/STABLE  i386
>Description:
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))
-----


>How-To-Repeat:
# cd /usr/ports/shells/scponly
# make install WITH_SCPONLY_RSYNC=yes
..
% rsync -avz ... with user which login shell is scponly.
>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.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->rushani 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Apr 25 01:44:11 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=96295 

From: Hideyuki KURASHINA <rushani@FreeBSD.org>
To: ueda@drweb.jp
Cc: edwin@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org,
 FreeBSD-gnats-submit@FreeBSD.org, rushani@FreeBSD.org
Subject: Re: ports/96295: shells/scponly cannot work with rsync
Date: Wed, 10 May 2006 00:34:09 +0900 (JST)

 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
State-Changed-From-To: open->suspended 
State-Changed-By: edwin 
State-Changed-When: Tue May 9 20:53:43 UTC 2006 
State-Changed-Why:  
Suspend on maintainers request. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=96295 

From: Edwin Groothuis <edwin@mavetju.org>
To: Hideyuki KURASHINA <rushani@FreeBSD.org>
Cc: ueda@drweb.jp, freebsd-ports-bugs@FreeBSD.org,
	FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/96295: shells/scponly cannot work with rsync
Date: Wed, 10 May 2006 06:54:35 +1000

 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/

From: Hideyuki KURASHINA <rushani@FreeBSD.org>
To: ueda@drweb.jp
Cc: edwin@mavetju.org, freebsd-ports-bugs@FreeBSD.org,
	FreeBSD-gnats-submit@FreeBSD.org, ""@FreeBSD.org
Subject: Re: ports/96295: shells/scponly cannot work with rsync
Date: Sat, 03 Jun 2006 12:31:32 +0900 (JST)

 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
 + 				 */

From: Hideyuki KURASHINA <rushani@FreeBSD.org>
To: ueda@drweb.jp
Cc: edwin@mavetju.org, freebsd-ports-bugs@FreeBSD.org,
	FreeBSD-gnats-submit@FreeBSD.org, ""@FreeBSD.org
Subject: Re: ports/96295: shells/scponly cannot work with rsync
Date: Sat, 03 Jun 2006 12:34:02 +0900 (JST)

 >>> 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
State-Changed-From-To: suspended->open 
State-Changed-By: edwin 
State-Changed-When: Sat Jun 3 07:45:56 UTC 2006 
State-Changed-Why:  
maintainer approved 

http://www.freebsd.org/cgi/query-pr.cgi?pr=96295 

From: UEDA Hiroyuki <ueda@drweb.jp>
To: Hideyuki KURASHINA <rushani@FreeBSD.org>
Cc: edwin@mavetju.org,
 freebsd-ports-bugs@FreeBSD.org,
 FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/96295: shells/scponly cannot work with rsync
Date: Sat, 03 Jun 2006 19:47:43 +0900

 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
 
State-Changed-From-To: open->closed 
State-Changed-By: arved 
State-Changed-When: Sun Aug 6 17:38:29 UTC 2006 
State-Changed-Why:  
Committed, thanks. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=96295 
>Unformatted:
