ports/127081: [PATCH] ports-mgmt/portlint: detect missuse of rmdirtry with absolute path

Tomoyuki Sakurai cherry at trombik.org
Thu Sep 4 04:00:06 UTC 2008


>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 at 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:



More information about the freebsd-ports-bugs mailing list