[MPlayer-users] vidix without being root or suid bit?

Alessandro Selli dhatarattha at libero.it
Wed Sep 18 16:27:01 CEST 2002


Il giorno Wed, 18 Sep 2002, D Richard Felker III così ha scritto:

|From: D Richard Felker III <dalias at aerifal.cx>
|To: mplayer-users at mplayerhq.hu
|Date: Wed, 18 Sep 2002 09:55:49 -0400
|Subject: Re: [MPlayer-users] vidix without being root or suid bit?
|

[...]

|
|No, the shell forks and then calls exec* syscalls. The kernel then
|looks at the binary whose name you passed to the exec syscall, and if
|you have permission to run it, it replaces the current process's
|address space with stuff to prepare for running the new binary. Also,
|if the suid bit is set, the kernel sets the euid of the process to
|match the file's owner.
|
|Now, if you have a dynamic linked efl binary, part of the kernel elf
|binary loader's job is to load /lib/ld-linux.so.2 (or whatever dynamic
|loader is specified in the binary's elf headers) and use it to perform
|the dynamic linking. If the kernel granted the process elevated
|privileges (suid flag), then the dynamic loaded and the code it's
|loading will have these privileges.
|
|Running "/lib/ld-linux.so.2 blah" yourself is quite different. The
|reason it works when blah is not executable is that you're actually
|running /lib/ld-linux.so.2. The name blah never gets passed to the
|kernel for exec'ing; ld-linux just loads it into memory and dynamic
|links it (similar to if the kernel had utilized ld-linux.so for this)
|and then transfers control to its entry point.
|
|Rich

  Thank you for this tutorial.  I take it's relesed under the Free
Documentation License, isn't it?  Some other people might be interested.

  Enough about it, we're quite off-topic now.

  :-)




  Sandro



-- 
Bellum se ipsum alet
       La guerra nutre se stessa

Livio, Ab urbe condita, XXXIV,9




More information about the MPlayer-users mailing list