DevHeads.net

a puzzle about start_kdeinit setuid root program in kde3?

hey all:
I have a puzzle about start_kdeinit in kde3 ,why does it need setuid
root ?
where does the root privilege use ? Is it need to write a root user file or
need to send a signal to
a root process, or the other case ? When I remove the "s" bit at
start_kdeinit, it seems runs ok.
And why does the start_kdeinit in kde4 needn't setuid root?

Comments

Re: a puzzle about start_kdeinit setuid root program in kde3?

By David Faure at 12/10/2011 - 05:11

On Wednesday 21 September 2011 15:46:22 Qin Bo wrote:
For the OOM protection, iirc.

r579164 | lunakl | 2006-08-31 11:50:34 +0200 (Thu, 31 Aug 2006) | 4 lines
OOM-killer protection for kdeinit master process.
OOM-killer protection for kdeinit master process.9706095&w=2
<a href="http://lists.kde.org/?l=kde-core-devel&amp;m=115452589706095&amp;w=2" title="http://lists.kde.org/?l=kde-core-devel&amp;m=115452589706095&amp;w=2">http://lists.kde.org/?l=kde-core-devel&amp;m=115452589706095&amp;w=2</a>

It does.

if (CMAKE_SYSTEM_NAME MATCHES Linux)
MESSAGE(STATUS "Using setuid root kdeinit wrapper in order to protect it from bad Linux OOM-killer")
set(KDEINIT_OOM_PROTECT 1)
install(CODE "
set(START_KDEINIT_PATH \"\$ENV{DESTDIR}${LIBEXEC_INSTALL_DIR}/start_kdeinit\")
EXECUTE_PROCESS(COMMAND sh -c \"chown 0 '\${START_KDEINIT_PATH}' && chmod u+s '\${START_KDEINIT_PATH}'\")
")
endif (CMAKE_SYSTEM_NAME MATCHES Linux)