ports/133667: ports/dirvish does not work with non-Bourne shells

Alex Povolotsky tarkhil at over.ru
Sun Apr 12 19:30:02 UTC 2009


>Number:         133667
>Category:       ports
>Synopsis:       ports/dirvish does not work with non-Bourne shells
>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:   Sun Apr 12 19:30:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Alex Povolotsky
>Release:        6.2-RELEASE-p7
>Organization:
>Environment:
FreeBSD services-new.iile.ru 6.2-RELEASE-p7 FreeBSD 6.2-RELEASE-p7 #1: Tue Jun  3 17:08:02 MSD 2008     tarkhil at services-new.iile.ru:/usr/obj/usr/src/sys/SERVICES  i386

>Description:
When dirvish calls scripts on remote machines, it silently assumes that the only possible shell is Bourne, so environment variables are passed like 

VAR=value VAR2=value2

in case of C-shell, default for root in FreeBSD, it's wrong.
>How-To-Repeat:
Call any remote script from dirvish
>Fix:
Apply a trivial patch, prepending variables list with "env"



Patch attached with submission follows:

--- ./dirvish.pl.orig	Sun Apr 12 10:37:17 2009
+++ ./dirvish.pl	Sun Apr 12 10:37:40 2009
@@ -935,14 +935,14 @@
 #	if ($A{dir} =~ /^:/)
 	if ($A{dir} !~ /^:/)
 	{
-		$rcmd = sprintf ("%s 'cd %s; %s %s' >>%s",
+		$rcmd = sprintf ("%s 'cd %s; env %s %s' >>%s",
 			("$A{shell}" || "/bin/sh -c"),
 			$A{dir}, $A{env},
 			$cmd,
 			$A{log}
 		);
 	} else {
-		$rcmd = sprintf ("%s '%s %s' >>%s",
+		$rcmd = sprintf ("%s 'env %s %s' >>%s",
 			("$A{shell}" || "/bin/sh -c"),
 			$A{env},
 			$cmd,


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



More information about the freebsd-ports-bugs mailing list