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

Bug#165417: libc6: ldd depends on file for files with exec bit off



On Sat, Oct 19, 2002 at 05:54:43PM +0900, GOTO Masanori wrote:
> At Sat, 19 Oct 2002 08:42:52 +1000,
> <herbert@gondor.apana.org.au> wrote:
> > The ldd script fails on non-executable files (such as most libraries)
> > if the file package is not installed.
> 
> This is caused by debian/patches/ldd.dpatch, which uses 'file' command.
> See below diff:
> 
>    -      eval $add_env '"$file"' || result=1
>    +      if [ ! -x "$file" ] && eval file -L "$file" 2>/dev/null \
>    +      | sed 10q | egrep "$file_magic_regex" > /dev/null; then
>    +        eval $add_env ${RTLD} '"$file"' || result=1
>    +      else
>    +        eval $add_env '"$file"' || result=1
>    +      fi

  haha, that's a good one, the very funny part is that file_magic_regex
is in fact ... empty. so that in fact the file -L test part is always
OK.

  I'd suggest rewrite the test into:

    if test -x "$file"; then
	eval $add_env ${RTLD} '"$file"' || result=1
    else
	eval $add_env '"$file"' || result=1
    fi

  I tested it here, and it seemed to work OK (no speed deterioration,
works OK on an executable without -x rights.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

Attachment: pgpsEjl6fdf5T.pgp
Description: PGP signature


Reply to: