ports/126337: [maintainer-update] sysutils/logrotate: olddir option fix

Balazs NAGY js at iksz.hu
Thu Aug 7 14:40:02 UTC 2008


>Number:         126337
>Category:       ports
>Synopsis:       [maintainer-update] sysutils/logrotate: olddir option fix
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 07 14:40:01 UTC 2008
>Closed-Date:
>Last-Modified:
>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 at 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 at 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:
>Unformatted:



More information about the freebsd-ports-bugs mailing list