a puzzle about start_kdeinit setuid root program in kde3?

David Faure faure at kde.org
Sat Dec 10 10:11:47 GMT 2011


On Wednesday 21 September 2011 15:46:22 Qin Bo wrote:
> hey all:
>     I have a puzzle about start_kdeinit in kde3 ,why does it need setuid
> root ?

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
http://lists.kde.org/?l=kde-core-devel&m=115452589706095&w=2

>  And why does the start_kdeinit in kde4 needn't setuid root?

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)

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by Nokia to work on KDE, incl. KDE Frameworks 5





More information about the kde-core-devel mailing list