summaryrefslogtreecommitdiffstats
path: root/sys/kern/imgact_elf.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>1999-07-05 18:38:29 +0000
committermarcel <marcel@FreeBSD.org>1999-07-05 18:38:29 +0000
commita8be8b77f4545754f6f6bdd42ac1c84e895e5e8d (patch)
treec9265be0ec066da346f9b1d8d729614ee33b1d20 /sys/kern/imgact_elf.c
parent8a83bdfe5934ec79cec98d7df57a36573237ad0a (diff)
downloadFreeBSD-src-a8be8b77f4545754f6f6bdd42ac1c84e895e5e8d.zip
FreeBSD-src-a8be8b77f4545754f6f6bdd42ac1c84e895e5e8d.tar.gz
Also try to load the interpreter without prepending "emul_path". This allows
dynamicly linked binaries to run in a chroot'd environment with "emul_path" as the new root. The new behavior of loading interpreters is identical to the principle of overlaying. PR: 10145
Diffstat (limited to 'sys/kern/imgact_elf.c')
-rw-r--r--sys/kern/imgact_elf.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index e3cceb3..36f582b 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: imgact_elf.c,v 1.57 1999/05/14 23:09:00 alc Exp $
+ * $Id: imgact_elf.c,v 1.58 1999/05/17 00:53:38 alc Exp $
*/
#include "opt_rlimit.h"
@@ -584,12 +584,16 @@ exec_elf_imgact(struct image_params *imgp)
imgp->proc->p_sysent = brand_info->sysvec;
if (interp != NULL) {
- snprintf(path, sizeof(path), "%s%s",
- 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;
+ snprintf(path, sizeof(path), "%s%s",
+ 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;
+ }
}
}
OpenPOWER on IntegriCloud