bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ENH: report correct cause of problem if ELF interpreter is missing


From: Ulrich Drepper
Subject: ENH: report correct cause of problem if ELF interpreter is missing
Date: 07 Mar 2002 17:58:57 -0800

At least the Linux kernel, probably others as well, have problems
communicating the fact that an executable failed to run because the ELF
interpreter (aka dynamic linker) is missing.  This does not happen so
often but every once in a while somebody tries to run an old binary and
stumbles across a curious error message saying that the binary itself
does not exist.  Without some knowledge about dynamic linking this
cannot be understood.

To solve the problem bash could invest some more effort when reporting
the problem.  The appended patch does just that.  If the error reported
is ENOENT but the stat succeeded and the file is no script with a #!
interpreter the new code will perform a check for an ELF file and if
this succeeded extract the PT_INTERP entry from the program header.

To do this one could use the libelf library commonly available but the
extra dependency can only cause problems. And the code to do the work in
bash itself isn't big.

I've tested the patch below on Linux with a very recent glibc.  I don't
expect any problems on other Linux systems.  And the way the patch is
written there hopefully won't be problems on other architectures either.

Chet, would you please consider applying the patch for the next release?

Thanks,

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

Attachment: bash-2.05a-pt_interp
Description: Text document

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]