From amdmi3@amdmi3.ru  Sun Jun  7 23:45:06 2009
Return-Path: <amdmi3@amdmi3.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3A88F1065673
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  7 Jun 2009 23:45:06 +0000 (UTC)
	(envelope-from amdmi3@amdmi3.ru)
Received: from smtp.timeweb.ru (smtp.timeweb.ru [217.170.79.85])
	by mx1.freebsd.org (Postfix) with ESMTP id ED6F68FC1B
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  7 Jun 2009 23:45:05 +0000 (UTC)
	(envelope-from amdmi3@amdmi3.ru)
Received: from [213.148.20.85] (helo=hive.panopticon)
	by smtp.timeweb.ru with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.69)
	(envelope-from <amdmi3@amdmi3.ru>)
	id 1MDS2y-0002Wy-Qe; Mon, 08 Jun 2009 03:45:04 +0400
Received: from hades.panopticon (hades.panopticon [192.168.0.32])
	by hive.panopticon (Postfix) with ESMTP id AC748B861;
	Mon,  8 Jun 2009 03:44:58 +0400 (MSD)
Received: by hades.panopticon (Postfix, from userid 1000)
	id A1831108840; Mon,  8 Jun 2009 03:44:58 +0400 (MSD)
Message-Id: <20090607234458.A1831108840@hades.panopticon>
Date: Mon,  8 Jun 2009 03:44:58 +0400 (MSD)
From: Dmitry Marakasov <amdmi3@amdmi3.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc: emulation@FreeBSD.org
Subject: [PATCH] emulators/linux_base-f10: incorrect bash usage
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         135337
>Category:       ports
>Synopsis:       [PATCH] emulators/linux_base-f10: incorrect bash usage
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-emulation
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 07 23:50:00 UTC 2009
>Closed-Date:    
>Last-Modified:  Wed Sep 22 12:39:54 UTC 2010
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 8.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD hades.panopticon 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Mon Jun  1 22:13:51 MSD
>Description:
Linux-base install bunch of scripts with #!/bin/bash shebang. That is obviously wrong.

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

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
run /usr/compat/linux/usr/bin/ldd
>Fix:
Either:
- shebang should be changed to ${LINUXBASE}/bin/bash (but that won't work in chroot)
- the port should depend on native bash
- shebang should be changed to #!/bin/sh if there are no compatibility problems
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->emulation 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Jun 7 23:50:11 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135337 
Responsible-Changed-From-To: emulation->freebsd-emulation 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Jun 14 00:26:52 UTC 2009 
Responsible-Changed-Why:  
Canonicalize assignment. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135337 

From: Boris Samorodov <bsam@ipt.ru>
To: bug-followup@FreeBSD.org,amdmi3@amdmi3.ru
Cc:  
Subject: Re: ports/135337: [PATCH] emulators/linux_base-f10: incorrect bash usage
Date: Sat, 08 Aug 2009 18:48:29 +0400

 Yep, the first suggestion won't work at chroot.
 Your second workaround should be added with "... and create a link
 /usr/local/bin/bash -> /bin/bash". Not good either.
 The third one does not work. :-(
 
 The best I can advice here is to use linux interpreter at command
 line (so it won't be evaluated while running the script):
 -----
 % /compat/linux/bin/sh /compat/linux/usr/bin/ldd /compat/linux/lib/libz.so.1
         libc.so.6 => /lib/libc.so.6 (0x2bc39000)
         /lib/ld-linux.so.2 (0x00000000)
 -----
 
 If anyone knows/suggests a better solution/patches -- I'm all ears.
 
 Thanks!
 
 -- 
 WBR, bsam

From: Dmitry Marakasov <amdmi3@amdmi3.ru>
To: Boris Samorodov <bsam@ipt.ru>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/135337: [PATCH] emulators/linux_base-f10: incorrect bash
 usage
Date: Mon, 10 Aug 2009 18:51:22 +0400

 * Boris Samorodov (bsam@ipt.ru) wrote:
 > If anyone knows/suggests a better solution/patches -- I'm all ears.
 
 /usr/bin/env bash, perhaps?
 
 -- 
 Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
 amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru    http://www.amdmi3.ru

From: Boris Samorodov <bsam@ipt.ru>
To: Dmitry Marakasov <amdmi3@amdmi3.ru>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/135337: [PATCH] emulators/linux_base-f10: incorrect bash usage
Date: Mon, 10 Aug 2009 21:05:35 +0400

 On Mon, 10 Aug 2009 18:51:22 +0400 Dmitry Marakasov wrote:
 > * Boris Samorodov (bsam@ipt.ru) wrote:
 
 > > If anyone knows/suggests a better solution/patches -- I'm all ears.
 > /usr/bin/env bash, perhaps?
 
 Whithout chroot the script will run as native FreeBSD script
 and won't look for linux paths.
 
 -- 
 WBR, Boris Samorodov (bsam)

From: Dmitry Marakasov <amdmi3@amdmi3.ru>
To: Boris Samorodov <bsam@ipt.ru>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/135337: [PATCH] emulators/linux_base-f10: incorrect bash
 usage
Date: Mon, 10 Aug 2009 21:36:11 +0400

 * Boris Samorodov (bsam@ipt.ru) wrote:
 
 > Whithout chroot the script will run as native FreeBSD script
 > and won't look for linux paths.
 
 Yes. Why is that bad?
 
 -- 
 Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
 amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru    http://www.amdmi3.ru

From: Boris Samorodov <bsam@ipt.ru>
To: Dmitry Marakasov <amdmi3@amdmi3.ru>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/135337: [PATCH] emulators/linux_base-f10: incorrect bash usage
Date: Mon, 10 Aug 2009 23:15:58 +0400

 On Mon, 10 Aug 2009 21:36:11 +0400 Dmitry Marakasov wrote:
 > * Boris Samorodov (bsam@ipt.ru) wrote:
 
 > > Whithout chroot the script will run as native FreeBSD script
 > > and won't look for linux paths.
 
 > Yes. Why is that bad?
 
 It just doesn't help! ;-)
 Well, at least not always. So it can't be a solution, just a new
 workaround.
 
 -----
 % bash --version
 GNU bash, version 4.0.24(0)-release (i386-portbld-freebsd8.0)
 Copyright (C) 2009 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 
 This is free software; you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.
 
 % ls
 file.1  file.2
 
 % cat /compat/linux/usr/bin/test-ls
 #!/usr/bin/env bash
 
 listing=`dir $1`
 echo $listing
 
 % LANG=C /compat/linux/usr/bin/test-ls
 /compat/linux/usr/bin/test-ls: line 3: dir: command not found
 % /compat/linux/bin/bash /compat/linux/usr/bin/test-ls
 file.1 file.2
 -----
 
 -- 
 WBR, bsam

From: Alexander Best <alexbestms@math.uni-muenster.de>
To: <bug-followup@FreeBSD.org>
Cc:  
Subject: Re: ports/135337: [PATCH] emulators/linux_base-f10: incorrect bash
 usage
Date: Wed, 16 Sep 2009 01:39:33 +0200 (CEST)

 did anybody ever try the patch enclosed in this PR ?
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=36952
 
 does it fix the issue?
 
 cheers.
 alex
Responsible-Changed-From-To: freebsd-emulation->emulation 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Sep 14 18:43:34 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135337 
Responsible-Changed-From-To: emulation->freebsd-emulation 
Responsible-Changed-By: arundel 
Responsible-Changed-When: Wed Sep 22 12:39:08 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135337 
>Unformatted:
