Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Apr 2009 19:22:09 GMT
From:      Alex Povolotsky <tarkhil@over.ru>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/133667: ports/dirvish does not work with non-Bourne shells 
Message-ID:  <200904121922.n3CJM9Yp095415@www.freebsd.org>
Resent-Message-ID: <200904121930.n3CJU1tK069020@freefall.freebsd.org>

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

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



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