diff -uNr kdenetwork-3.1.4~/lanbrowsing/lisa/main.cpp kdenetwork-3.1.4/lanbrowsing/lisa/main.cpp --- kdenetwork-3.1.4~/lanbrowsing/lisa/main.cpp 2003-05-21 16:24:22 +0400 +++ kdenetwork-3.1.4/lanbrowsing/lisa/main.cpp 2003-11-04 14:00:54 +0300 @@ -24,6 +24,7 @@ #include #include #include +#include // detect linux/glibc for the gnu style --args #if defined(__linux__) || defined(__linux) || defined(linux) @@ -248,13 +249,21 @@ //for creating a raw socket //now dropping root privileges once and ever - setuid(getuid()); + struct passwd *pwnam = getpwnam("_kdelisa"); + if (pwnam) + { + setuid(pwnam->pw_uid); + } + else + { + std::cerr << "User _kdelisa not found." << std::endl; + exit(1); + } //according to R. Stevens the following three lines //make daemons feel good :) setsid(); chdir("/"); - umask(0); getDebug()<<"main starting, dropped root privileges"< #include #include +#include // detect linux/glibc for the gnu style --args #if defined(__linux__) || defined(__linux) || defined(linux) @@ -228,13 +229,21 @@ //for creating a raw socket //now dropping root privileges once and ever - setuid(getuid()); + struct passwd *pwnam = getpwnam("_kdelisa"); + if (pwnam) + { + setuid(pwnam->pw_uid); + } + else + { + std::cerr << "User _kdelisa not found." << std::endl; + exit(1); + } //according to R. Stevens the following three lines //make daemons feel good :) setsid(); chdir("/"); - umask(0); getDebug()<<"main starting, dropped root privileges"<