From owner-freebsd-bugs@FreeBSD.ORG Mon Oct 30 01:50:28 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F10AB16A40F for ; Mon, 30 Oct 2006 01:50:27 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3BE2243D5A for ; Mon, 30 Oct 2006 01:50:19 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k9U1oJLj033339 for ; Mon, 30 Oct 2006 01:50:19 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k9U1oIOW033335; Mon, 30 Oct 2006 01:50:18 GMT (envelope-from gnats) Resent-Date: Mon, 30 Oct 2006 01:50:18 GMT Resent-Message-Id: <200610300150.k9U1oIOW033335@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, David Wood Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9916216A494 for ; Mon, 30 Oct 2006 01:40:53 +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 5291743D45 for ; Mon, 30 Oct 2006 01:40:53 +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 k9U1erSC039583 for ; Mon, 30 Oct 2006 01:40:53 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k9U1eqbl039582; Mon, 30 Oct 2006 01:40:52 GMT (envelope-from nobody) Message-Id: <200610300140.k9U1eqbl039582@www.freebsd.org> Date: Mon, 30 Oct 2006 01:40:52 GMT From: David Wood To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: misc/104919: [patch] fix sysutils/cronolog X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Oct 2006 01:50:28 -0000 >Number: 104919 >Category: misc >Synopsis: [patch] fix sysutils/cronolog >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Oct 30 01:50:18 GMT 2006 >Closed-Date: >Last-Modified: >Originator: David Wood >Release: FreeBSD 6.1-RELEASE i386 >Organization: >Environment: FreeBSD tungsten.wood2.org.uk 6.1-RELEASE-p10 FreeBSD 6.1-RELEASE-p10 #0: Fri Oct 6 10:56:46 BST 2006 david@titanium.wood2.org.uk:/usr/obj/usr/src/sys/TITANIUM i386 >Description: http://cronolog.org/patches/cronolog-missing-symlink-patch.txt describes a fix for cronolog when the destination of a symlink that cronolog is attempting to update no longer exists. On my machine this happens because cron comes along and gzips the logs. >How-To-Repeat: Delete or rename a file that cronolog has symlinked to when using the --symlink= option. The symlink won't be updated in the future. >Fix: The following turns the patch described in http://cronolog.org/patches/cronolog-missing-symlink-patch.txt into a unified diff and applies it before the (optional) setuid/setgid patch. Attempting to apply this patch after the setuid/setgid patch (for example, by calling the file files/patch...) fails, as the line numbers in cronoutils.c have been changed by the setuid/setgid patch. Note the new file - files/cronolog-missing_symlink_bug-patch --- Patch begins --- diff -ruN /usr/ports/sysutils/cronolog/Makefile /root/ports-updated/cronolog/Makefile --- /usr/ports/sysutils/cronolog/Makefile Mon Jun 19 20:06:57 2006 +++ /root/ports-updated/cronolog/Makefile Mon Oct 30 01:30:02 2006 @@ -7,7 +7,7 @@ PORTNAME= cronolog PORTVERSION= 1.6.2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils MASTER_SITES= http://cronolog.org/download/ @@ -23,12 +23,14 @@ .include +EXTRA_PATCHES= files/cronolog-missing_symlink_bug-patch +PATCH_WRKSRC= ${WRKDIR} + .if !defined(WITHOUT_SETUID_PATCH) MASTER_SITES+= http://cronolog.org/patches/:patches DISTFILES= ${DISTNAME}${EXTRACT_SUFX} cronolog-setugid-patch.txt:patches EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} -EXTRA_PATCHES= ${WRKDIR}/cronolog-setugid-patch.txt -PATCH_WRKSRC= ${WRKDIR} +EXTRA_PATCHES+= ${WRKDIR}/cronolog-setugid-patch.txt USE_DOS2UNIX= ../cronolog-setugid-patch.txt post-extract: diff -ruN /usr/ports/sysutils/cronolog/files/cronolog-missing_symlink_bug-patch /root/ports-updated/cronolog/files/cronolog-missing_symlink_bug-patch --- /usr/ports/sysutils/cronolog/files/cronolog-missing_symlink_bug-patch Thu Jan 1 00:00:00 1970 +++ /root/ports-updated/cronolog/files/cronolog-missing_symlink_bug-patch Mon Oct 30 01:20:27 2006 @@ -0,0 +1,12 @@ +--- cronolog-1.6.2/src/cronoutils.c.orig Thu May 3 16:43:21 2001 ++++ cronolog-1.6.2/src/cronoutils.c Mon Oct 30 00:33:40 2006 +@@ -199,7 +199,7 @@ + { + unlink(prevlinkname); + } +- if (stat(linkname, &stat_buf) == 0) ++ if (lstat(linkname, &stat_buf) == 0) + { + if (prevlinkname) { + rename(linkname, prevlinkname); + --- Patch ends --- >Release-Note: >Audit-Trail: >Unformatted: