From eugen@hq.svzserv.kemerovo.su  Fri Nov 24 18:13:36 2006
Return-Path: <eugen@hq.svzserv.kemerovo.su>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id EB26C16A47B;
	Fri, 24 Nov 2006 18:13:35 +0000 (UTC)
	(envelope-from eugen@hq.svzserv.kemerovo.su)
Received: from hq.svzserv.kemerovo.su (hq.svzserv.kemerovo.su [213.184.65.65])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B93B643D58;
	Fri, 24 Nov 2006 18:12:52 +0000 (GMT)
	(envelope-from eugen@hq.svzserv.kemerovo.su)
Received: from hq.svzserv.kemerovo.su (smmsp@localhost [127.0.0.1])
	by hq.svzserv.kemerovo.su (8.13.8/8.13.8) with ESMTP id kAOIDSiE017540;
	Sat, 25 Nov 2006 01:13:28 +0700 (KRAT)
	(envelope-from eugen@hq.svzserv.kemerovo.su)
Received: (from root@localhost)
	by hq.svzserv.kemerovo.su (8.13.8/8.13.8/Submit) id kAOIDRdF017539;
	Sat, 25 Nov 2006 01:13:27 +0700 (KRAT)
	(envelope-from eugen)
Message-Id: <200611241813.kAOIDRdF017539@hq.svzserv.kemerovo.su>
Date: Sat, 25 Nov 2006 01:13:27 +0700 (KRAT)
From: Eugene Grosbein <eugen@grosbein.pp.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc: ehaupt@freebsd.org
Subject: [patch] make archivers/unzoo more FreeBSD 4.x friendly
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         105832
>Category:       ports
>Synopsis:       [patch] make archivers/unzoo more FreeBSD 4.x friendly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ehaupt
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 24 18:20:05 GMT 2006
>Closed-Date:    Sat Nov 25 00:51:12 CET 2006
>Last-Modified:  Sat Nov 25 00:00:24 GMT 2006
>Originator:     Eugene Grosbein
>Release:        FreeBSD 4.11-STABLE i386
>Organization:
Svyaz Service JSC
>Environment:
System: FreeBSD hq.svzserv.kemerovo.su 4.11-STABLE FreeBSD 4.11-STABLE #0: Mon Oct 16 18:31:57 KRAST 2006 root@hq.svzserv.kemerovo.su:/usr/obj/usr/src/sys/MAIN i386

>Description:
	Recent security update of archivers/unzoo introduced
	dependency on gcc 3.2+. Meantime, this port is a dependency
	of clamav antivirus widely used to detect viruses in SMTP traffic.
	This requires all FreeBSD 4.x users to build new gcc
	for very small reason. It seems that this overhead may be
	skipped with next small patch that does nothing other than
	moves 'found_trav' variable initialisations to the start
	of code blocks.

>How-To-Repeat:
	N/A, see description.

>Fix:

	This removes dependency on gcc 3.2+

diff -urN unzoo.orig/Makefile unzoo/Makefile
--- unzoo.orig/Makefile	Sat Nov 25 00:46:18 2006
+++ unzoo/Makefile	Sat Nov 25 01:02:20 2006
@@ -7,7 +7,7 @@
 
 PORTNAME=	unzoo
 PORTVERSION=	4.4
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	archivers
 MASTER_SITES=	${MASTER_SITE_DEBIAN_POOL}
 DISTNAME=	${PORTNAME}_${PORTVERSION}.orig
@@ -18,8 +18,6 @@
 
 MAINTAINER=	ehaupt@FreeBSD.org
 COMMENT=	A zoo archive extractor
-
-USE_GCC=	3.2+
 
 EXTRA_DEFINES=	-DSYS_IS_UNIX -DSYS_HAS_MKDIR
 
diff -urN unzoo.orig/files/patch-unzoo.c unzoo/files/patch-unzoo.c
--- unzoo.orig/files/patch-unzoo.c	Thu Jan  1 07:00:00 1970
+++ unzoo/files/patch-unzoo.c	Sat Nov 25 01:00:45 2006
@@ -0,0 +1,48 @@
+--- unzoo.c.orig	Sat Nov 25 00:53:57 2006
++++ unzoo.c	Sat Nov 25 01:00:42 2006
+@@ -2590,20 +2590,20 @@
+             /* but only if the user did not request otherwise              */
+ 
+             /* building the universal path of this member                  */
++            int found_trav = 0;
+             char patu [sizeof(Entry.diru) + sizeof(Entry.namu) + 2];
+             strcpy( patu, Entry.diru );
+             if ( strlen(patu) && patu[strlen(patu)-1] != '/') strcat( patu, "/" );
+             strcat( patu, (Entry.lnamu ? Entry.namu : Entry.nams) );
+ 
+-            int found_trav = 0;
+ 
+             if ( strstr( patu, "/../" )) {
+-                found_trav = 1;
+ 
+                 /* remove "/../" from the path                             */
+                 char tmp [sizeof(patu)];
+                 char *p;
+                 char *q;
++                found_trav = 1;
+                 memset(tmp, 0, sizeof(tmp));
+                 q = patu;
+ 
+@@ -2625,10 +2625,10 @@
+                 printf("unzoo: skipped \"/../\" path component(s) in '%s'\n", Entry.patl);
+             }
+             if ( *patu == '/' && !strlen( pre ) ) {
+-                found_trav = 1;
+ 
+                 char *p = malloc(sizeof(patu));
+                 char *q = p;
++                found_trav = 1;
+                 memset(p, 0, sizeof(patu));
+                 strcpy(p, patu);
+                 while ( q[0] == '/' ) q++;
+@@ -2638,9 +2638,9 @@
+                 printf("unzoo: skipped root directory path component in '%s'\n", patl);
+             }
+             if ( !strncmp( patu, "../", 3 )) {
+-                found_trav = 1;
+ 
+                 char tmp [sizeof(patu)];
++                found_trav = 1;
+                 memset(tmp, 0, sizeof(tmp));
+                 strcpy(tmp, patu + 3);
+                 strcpy(patu, tmp);


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->ehaupt 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Fri Nov 24 18:20:20 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=105832 
State-Changed-From-To: open->closed 
State-Changed-By: ehaupt 
State-Changed-When: Sat Nov 25 00:50:24 CET 2006 
State-Changed-Why:  
Patch committed, thank you very much for your contribution. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/105832: commit references a PR
Date: Fri, 24 Nov 2006 23:50:26 +0000 (UTC)

 ehaupt      2006-11-24 23:49:46 UTC
 
   FreeBSD ports repository
 
   Modified files:
     archivers/unzoo      Makefile 
   Added files:
     archivers/unzoo/files patch-unzoo.c 
   Log:
   Provide a patch that moves 'found_trav' variable initialisations to the start
   of code blocks to drop gcc 3.2 dependency on 4.x. Bump PORTREVISION.
   
   PR:             105832
   Submitted by:   Eugene Grosbein <eugen@grosbein.pp.ru>
   
   Revision  Changes    Path
   1.10      +1 -3      ports/archivers/unzoo/Makefile
   1.1       +48 -0     ports/archivers/unzoo/files/patch-unzoo.c (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
