[Rpm-maint] [PATCH] Split the processing programs and libraries

Panu Matilainen pmatilai at laiskiainen.org
Thu Nov 11 13:05:27 UTC 2010


On Sat, 30 Oct 2010, Alexey Gladkov wrote:

> The elfdeps runs only for executable files, but some
> Linux distributions, remove the executable bit from shared libraries.
>
[...]
> diff --git a/fileattrs/elf.attr b/fileattrs/elf.attr
> index fba180b..7355b8f 100644
> --- a/fileattrs/elf.attr
> +++ b/fileattrs/elf.attr
> @@ -1,4 +1,4 @@
> %__elf_provides		%{_rpmconfigdir}/elfdeps --provides %{?__filter_GLIBC_PRIVATE:--filter-private}
> %__elf_requires		%{_rpmconfigdir}/elfdeps --requires %{?__filter_GLIBC_PRIVATE:--filter-private}
> -%__elf_magic		^ELF (32|64)-bit.*$
> +%__elf_magic		^ELF (32|64)-bit.* executable, .*$
                                          ^^^^^^^^^^^^
BTW just noticed something strange here... Looking around /bin/ and 
friends on Fedora 13/14, not all executables are identified as such. For 
example:

[pmatilai at dhcp102 ~]$ file /bin/*|grep ELF|grep -v executable
/bin/dbus-daemon:                   ELF 64-bit LSB shared object, x86-64, 
version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 
2.6.32, stripped
/bin/mount:                         setuid ELF 64-bit LSB shared object, 
x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for 
GNU/Linux 2.6.32, stripped
/bin/su:                            setuid ELF 64-bit LSB shared object, 
x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for 
GNU/Linux 2.6.32, stripped
/bin/tracepath:                     ELF 64-bit LSB shared object, x86-64, 
version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 
2.6.18, stripped
/bin/tracepath6:                    ELF 64-bit LSB shared object, x86-64, 
version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 
2.6.18, stripped
/bin/umount:                        setuid ELF 64-bit LSB shared object, 
x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for 
GNU/Linux 2.6.32, stripped

All these are rather obviously executable, so the question is why doesn't 
file see them as such? Time to go digging around in libmagic I guess...
Anyway this does mean that we need to tread carefully, ELF executables and 
shared objects need to share the same rule(s) until this is resolved 
somehow.

 	- Panu -


More information about the Rpm-maint mailing list