misc/104919: [patch] fix sysutils/cronolog

David Wood david at wood2.org.uk
Mon Oct 30 01:50:28 UTC 2006


>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 at 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 <bsd.port.pre.mk>
 
+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:


More information about the freebsd-bugs mailing list