From nobody@FreeBSD.ORG Thu Feb 18 03:25:51 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 122FF112CA; Thu, 18 Feb 1999 03:25:50 -0800 (PST)
Message-Id: <19990218112550.122FF112CA@hub.freebsd.org>
Date: Thu, 18 Feb 1999 03:25:50 -0800 (PST)
From: marcel@scc.nl
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: ELF interpreter loading in chrooted situations
X-Send-Pr-Version: www-1.0

>Number:         10145
>Category:       kern
>Synopsis:       ELF interpreter loading in chrooted situations
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 18 03:30:01 PST 1999
>Closed-Date:    Mon Jul 5 11:39:33 PDT 1999
>Last-Modified:  Mon Jul  5 11:41:12 PDT 1999
>Originator:     Marcel Moolenaar
>Release:        3.1-STABLE
>Organization:
SCC
>Environment:
FreeBSD scones.sup.scc.nl 3.1-BETA FreeBSD 3.1-BETA #24: Thu Feb 18 11:39:49 CET 1999     marcel@scones.sup.scc.nl:/usr/src/sys/compile/SCONES  i386

>Description:
Linux ELF interpreters, for example, are expected under /compat/linux.
Those binaries cannot be run in a chrooted environment (with the root
set to /compat/linux), because the interpreter cannot be found. The
patch allows the loading/running of ELF binaries in such cases.

>How-To-Repeat:
n/a
>Fix:
Index: imgact_elf.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/imgact_elf.c,v
retrieving revision 1.44.2.3
diff -c -r1.44.2.3 imgact_elf.c
*** imgact_elf.c        1999/02/08 18:58:36     1.44.2.3
--- imgact_elf.c        1999/02/18 11:17:47
***************
*** 565,572 ****
                    brand_info->emul_path, interp);
                  if ((error = elf_load_file(imgp->proc, path, &addr,
                    &imgp->entry_addr)) != 0) {
!                         uprintf("ELF interpreter %s not found\n", path);
!                         goto fail;
                  }
        }
  
--- 565,575 ----
                    brand_info->emul_path, interp);
                  if ((error = elf_load_file(imgp->proc, path, &addr,
                    &imgp->entry_addr)) != 0) {
!                       if ((error = elf_load_file(imgp->proc, interp, &addr,
!                           &imgp->entry_addr)) != 0) {
!                         uprintf("ELF interpreter %s not found\n", path);
!                         goto fail;
!                       }
                  }
        }
  


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: marcel 
State-Changed-When: Mon Jul 5 11:39:33 PDT 1999 
State-Changed-Why:  
Patch applied 
>Unformatted:
