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

Kirill A. Shutemov kirill at shutemov.name
Thu Nov 11 13:32:51 UTC 2010


On Thu, Nov 11, 2010 at 03:05:27PM +0200, Panu Matilainen wrote:
> 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?

All PIE binaries are ELF shared object, not ELF executable.

In ALT Linux RPM we have some heuristic to check whether a shared object
is executable:

http://git.altlinux.org/people/ldv/packages/rpm.git?p=rpm.git;a=blob;f=scripts/fixup-libraries

It's rather robust.

> 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 -
> _______________________________________________
> Rpm-maint mailing list
> Rpm-maint at lists.rpm.org
> http://lists.rpm.org/mailman/listinfo/rpm-maint

-- 
 Kirill A. Shutemov


More information about the Rpm-maint mailing list