From nobody@FreeBSD.org  Thu Aug  7 14:34:26 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 60D861065682
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  7 Aug 2008 14:34:26 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 4E84B8FC13
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  7 Aug 2008 14:34:26 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m77EYPvb081599
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 7 Aug 2008 14:34:25 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m77EYPtb081598;
	Thu, 7 Aug 2008 14:34:25 GMT
	(envelope-from nobody)
Message-Id: <200808071434.m77EYPtb081598@www.freebsd.org>
Date: Thu, 7 Aug 2008 14:34:25 GMT
From: Balazs NAGY <js@iksz.hu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [maintainer-update] sysutils/logrotate: olddir option fix
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         126337
>Category:       ports
>Synopsis:       [maintainer-update] sysutils/logrotate: olddir option fix
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    miwi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 07 14:40:01 UTC 2008
>Closed-Date:    Fri Aug 15 19:19:45 UTC 2008
>Last-Modified:  Fri Aug 15 19:30:02 UTC 2008
>Originator:     Balazs NAGY
>Release:        7.0-RELEASE
>Organization:
>Environment:
FreeBSD tcb.aranyoroszlan.hu 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008     root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
logrotate's path-type options (eg. compress, olddir, just to name a few) fail because FreeBSD's libc implements mbtrowc(3) differently, and returns -2 on empty string.  Linux version, however, returns 0.

A simple zero-length check added to path check function, which hides this.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

From 6d3976f0a76ee342114531fd9da63e3e5b294f9c Mon Sep 17 00:00:00 2001
From: Balazs Nagy <js@iksz.hu>
Date: Thu, 7 Aug 2008 15:32:06 +0200
Subject: [PATCH] [maintainer-update] olddir fix

Because of differences in mbrtowc(3) implementation among platforms, checks
against empty strings should be avoided.
---
 Makefile       |    1 +
 files/patch-aa |   21 +++++++++++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 7788325..533fadf 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,7 @@
 
 PORTNAME=		logrotate
 PORTVERSION=		3.7.7
+PORTREVISION=		1
 CATEGORIES=		sysutils
 MASTER_SITES=		https://fedorahosted.org/releases/l/o/logrotate/
 DISTNAME=		${PORTNAME}-${PORTVERSION}
diff --git a/files/patch-aa b/files/patch-aa
index fd9dfbe..fb7868c 100644
--- a/files/patch-aa
+++ b/files/patch-aa
@@ -1,6 +1,6 @@
-diff -ruN logrotate-3.7.7-orig/config.c logrotate-3.7.7/config.c
---- logrotate-3.7.7-orig/config.c	Fri May  9 07:28:59 2008
-+++ logrotate-3.7.7/config.c	Sun Jun 22 22:10:25 2008
+diff -u logrotate-3.7.7-orig/config.c logrotate-3.7.7/config.c
+--- logrotate-3.7.7-orig/config.c	2008-08-07 15:10:36.000000000 +0200
++++ logrotate-3.7.7/config.c	2008-08-07 15:11:54.000000000 +0200
 @@ -1,5 +1,4 @@
  #include <sys/queue.h>
 -#include <alloca.h>
@@ -15,9 +15,18 @@ diff -ruN logrotate-3.7.7-orig/config.c logrotate-3.7.7/config.c
  
  #include "basenames.h"
  #include "log.h"
-diff -ruN logrotate-3.7.7-orig/logrotate.c logrotate-3.7.7/logrotate.c
---- logrotate-3.7.7-orig/logrotate.c	Wed May 14 10:31:35 2008
-+++ logrotate-3.7.7/logrotate.c	Sun Jun 22 22:10:25 2008
+@@ -93,7 +93,7 @@
+ 
+ 	chptr = start;
+ 
+-	while( (len = mbrtowc(&pwc, chptr, strlen(chptr), NULL)) != 0 ) {
++	while( (len = strlen(chptr)) != 0 && (len = mbrtowc(&pwc, chptr, len, NULL)) != 0 ) {
+ 		if( len == (size_t)(-1) || len == (size_t)(-2) || !iswprint(pwc) || iswblank(pwc) ) {
+ 		    message(MESS_ERROR, "%s:%d bad %s path %s\n",
+ 			    configFile, lineNum, key, start);
+diff -u logrotate-3.7.7-orig/logrotate.c logrotate-3.7.7/logrotate.c
+--- logrotate-3.7.7-orig/logrotate.c	2008-08-07 15:10:36.000000000 +0200
++++ logrotate-3.7.7/logrotate.c	2008-08-07 15:10:43.000000000 +0200
 @@ -1,5 +1,4 @@
  #include <sys/queue.h>
 -#include <alloca.h>
-- 
1.5.6.2


>Release-Note:
>Audit-Trail:
Class-Changed-From-To: sw-bug->maintainer-update 
Class-Changed-By: edwin 
Class-Changed-When: Thu Aug 7 14:40:28 UTC 2008 
Class-Changed-Why:  
Fix category (submitter is maintainer) (via the GNATS Auto Assign Tool) 

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

From: =?UTF-8?B?TmFneSBCYWzDoXpz?= <js@iksz.hu>
To: bug-followup@FreeBSD.org, js@iksz.hu
Cc:  
Subject: Re: ports/126337: [maintainer-update] sysutils/logrotate: olddir
 option fix
Date: Thu, 14 Aug 2008 09:42:25 +0200

 Committers?
Responsible-Changed-From-To: freebsd-ports-bugs->miwi 
Responsible-Changed-By: miwi 
Responsible-Changed-When: Thu Aug 14 08:49:28 UTC 2008 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=126337 
State-Changed-From-To: open->closed 
State-Changed-By: miwi 
State-Changed-When: Fri Aug 15 19:19:44 UTC 2008 
State-Changed-Why:  
Committed. Thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/126337: commit references a PR
Date: Fri, 15 Aug 2008 19:19:58 +0000 (UTC)

 miwi        2008-08-15 19:19:35 UTC
 
   FreeBSD ports repository
 
   Modified files:
     sysutils/logrotate   Makefile 
     sysutils/logrotate/files patch-aa 
   Log:
   - Olddir options fix
   
        logrotate's path-type options (eg. compress, olddir,
        just to name a few) fail because FreeBSD's libc
        implements mbtrowc(3) differently, and returns -2 on
        empty string. Linux version, however, returns 0.
   
        A simple zero-length check added to path check function,
        which hides this.
   
   PR:             126337
   Submitted by:   Balazs NAGY <js@iksz.hu> (maintainer)
   
   Revision  Changes    Path
   1.26      +1 -0      ports/sysutils/logrotate/Makefile
   1.7       +15 -6     ports/sysutils/logrotate/files/patch-aa
 _______________________________________________
 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:
