All of lore.kernel.org
 help / color / mirror / Atom feed
* how can I compile mount and umount as shared object files?
@ 2011-11-23  0:02 Paul Stone
  2011-11-23 18:58 ` Mike Frysinger
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Stone @ 2011-11-23  0:02 UTC (permalink / raw)
  To: util-linux

Hi all,

I'm trying to build util-linux-ng-2.19.1, specifically to get the
updated mount and umount in order to work around a bug which
interferes with FUSE.  But, building from source with 'make
install-strip' produces executables, as opposed to shared object files
like the ones which are in the /bin directory of my CentOS 6
distribution.  Can anyone enlighten me on how to produce shared object
files for these two utilities?  I also don't know what the distinction
is between SYSV and GNU/Linux in terms of the identification of the
file type.

[root@xxxx .libs]# file *
mount:  setuid ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
umount: setuid ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

[root@xxxx .libs]# file /bin/mount /bin/umount
/bin/mount:  setuid ELF 64-bit LSB shared object, x86-64, version 1
(GNU/Linux), 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
(GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux
2.6.18, stripped

Thanks and best regards,
Paul Stone

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how can I compile mount and umount as shared object files?
  2011-11-23  0:02 how can I compile mount and umount as shared object files? Paul Stone
@ 2011-11-23 18:58 ` Mike Frysinger
  2011-11-27  0:34   ` Paul Stone
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2011-11-23 18:58 UTC (permalink / raw)
  To: Paul Stone; +Cc: util-linux

[-- Attachment #1: Type: Text/Plain, Size: 929 bytes --]

On Tuesday 22 November 2011 19:02:26 Paul Stone wrote:
> [root@xxxx .libs]# file *
> mount:  setuid ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
> dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
> umount: setuid ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
> dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
> 
> [root@xxxx .libs]# file /bin/mount /bin/umount
> /bin/mount:  setuid ELF 64-bit LSB shared object, x86-64, version 1
> (GNU/Linux), 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
> (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux
> 2.6.18, stripped

looks like your objects in /bin/ are PIEs.  it's not required for these to be 
PIEs, so you can install the locally compiled ones if you want and they should 
work fine.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how can I compile mount and umount as shared object files?
  2011-11-23 18:58 ` Mike Frysinger
@ 2011-11-27  0:34   ` Paul Stone
  2011-11-27  1:10     ` Mike Frysinger
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Stone @ 2011-11-27  0:34 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: util-linux

Thanks Mike,

The compiled regular executables do seem to work fine.

Any idea why they are compiled as PIEs for CentOS (and presumably Red Hat)?

Best Regards,
Paul Stone


On Wed, Nov 23, 2011 at 10:58 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Tuesday 22 November 2011 19:02:26 Paul Stone wrote:
>> [root@xxxx .libs]# file *
>> mount:  setuid ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
>> dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
>> umount: setuid ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
>> dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
>>
>> [root@xxxx .libs]# file /bin/mount /bin/umount
>> /bin/mount:  setuid ELF 64-bit LSB shared object, x86-64, version 1
>> (GNU/Linux), 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
>> (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux
>> 2.6.18, stripped
>
> looks like your objects in /bin/ are PIEs.  it's not required for these to be
> PIEs, so you can install the locally compiled ones if you want and they should
> work fine.
> -mike
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how can I compile mount and umount as shared object files?
  2011-11-27  0:34   ` Paul Stone
@ 2011-11-27  1:10     ` Mike Frysinger
  2011-11-28  9:01       ` Karel Zak
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2011-11-27  1:10 UTC (permalink / raw)
  To: Paul Stone; +Cc: util-linux

[-- Attachment #1: Type: Text/Plain, Size: 338 bytes --]

On Saturday 26 November 2011 19:34:38 Paul Stone wrote:
> Thanks Mike,

please don't top post

> Any idea why they are compiled as PIEs for CentOS (and presumably Red Hat)?

i vaguely recall that RedHat's policy is to build all set*id and network 
daemons as PIEs as security precautions.  Karel would probably know more.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how can I compile mount and umount as shared object files?
  2011-11-27  1:10     ` Mike Frysinger
@ 2011-11-28  9:01       ` Karel Zak
  0 siblings, 0 replies; 5+ messages in thread
From: Karel Zak @ 2011-11-28  9:01 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: Paul Stone, util-linux

On Sat, Nov 26, 2011 at 08:10:02PM -0500, Mike Frysinger wrote:
> On Saturday 26 November 2011 19:34:38 Paul Stone wrote:
> > Thanks Mike,
> 
> please don't top post
> 
> > Any idea why they are compiled as PIEs for CentOS (and presumably Red Hat)?
> 
> i vaguely recall that RedHat's policy is to build all set*id and network 
> daemons as PIEs as security precautions.  Karel would probably know more.

 Yes, copy & past from util-linux.spec:

    export SUID_CFLAGS="-fpie"
    export SUID_LDFLAGS="-pie"
    %configure \
      ....

 the SUID_* variable are supported by upstream, see
 Documentation/howto-compilation.txt

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-11-28  9:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-23  0:02 how can I compile mount and umount as shared object files? Paul Stone
2011-11-23 18:58 ` Mike Frysinger
2011-11-27  0:34   ` Paul Stone
2011-11-27  1:10     ` Mike Frysinger
2011-11-28  9:01       ` Karel Zak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.