Skip site navigation (1)Skip section navigation (2)
Date:      Thu,  4 Sep 2008 12:54:03 +0900 (JST)
From:      Tomoyuki Sakurai <cherry@trombik.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        marcus@FreeBSD.org
Subject:   ports/127081: [PATCH] ports-mgmt/portlint: detect missuse of rmdirtry with absolute path
Message-ID:  <20080904035403.BD8AA1CD54@spica.trombik.org>
Resent-Message-ID: <200809040400.m84406CY025061@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         127081
>Category:       ports
>Synopsis:       [PATCH] ports-mgmt/portlint: detect missuse of rmdirtry with absolute path
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 04 04:00:06 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Tomoyuki Sakurai
>Release:        FreeBSD 7.0-STABLE amd64
>Organization:
>Environment:
System: FreeBSD spica.trombik.org 7.0-STABLE FreeBSD 7.0-STABLE #5: Thu Jul 10 22:29:26 JST 2008
>Description:

Even if you use @rmdirtry with absolute path, it doesn't remove the directory.
The path will be prefixed with the current directory pointer.
"@rmdirtry /var/foo" will remove ${PREFIX}//var/foo.

Port maintainer (marcus@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:

--- portlint-2.10.1.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/ports-mgmt/portlint/Makefile /usr/home/cherry/svk/ports/ports-mgmt/portlint/Makefile
--- /usr/ports/ports-mgmt/portlint/Makefile	2008-08-25 02:16:03.000000000 +0900
+++ /usr/home/cherry/svk/ports/ports-mgmt/portlint/Makefile	2008-09-04 12:48:04.000000000 +0900
@@ -8,7 +8,7 @@
 #
 
 PORTNAME=	portlint
-PORTVERSION=	2.10.0
+PORTVERSION=	2.10.1
 CATEGORIES=	ports-mgmt
 MASTER_SITES=	# none
 DISTFILES=	# none
diff -ruN --exclude=CVS /usr/ports/ports-mgmt/portlint/src/portlint.pl /usr/home/cherry/svk/ports/ports-mgmt/portlint/src/portlint.pl
--- /usr/ports/ports-mgmt/portlint/src/portlint.pl	2008-08-25 02:16:03.000000000 +0900
+++ /usr/home/cherry/svk/ports/ports-mgmt/portlint/src/portlint.pl	2008-09-04 12:49:46.000000000 +0900
@@ -750,6 +750,11 @@
 				$rcsidseen++ if (/\$$rcsidstr[:\$]/);
 			} elsif ($_ =~ /^\@(owner|group|mode)\s/) {
 				&perror("WARN", $file, $., "\@$1 should not be needed");
+			} elsif ($_ =~ m!^\@(dirrm|dirrmtry)\s+/! ) {
+				&perror("WARN", $file, $., "Using \@$1 with absolute path will not work ".
+					"as you expected in most cases. ".
+					"Use pkg-deinstall if you want to remove a directory ".
+					"such as /var/\${PORTNAME}");
 			} elsif ($_ =~ /^\@(dirrm|option|stopdaemon)/) {
 				; # no check made
 			} elsif ($_ eq "\@cwd") {
--- portlint-2.10.1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080904035403.BD8AA1CD54>