diff -uNr kdenetwork-3.5.4~/lanbrowsing/lisa/main.cpp kdenetwork-3.5.4/lanbrowsing/lisa/main.cpp --- kdenetwork-3.5.4/lanbrowsing/lisa/main.cpp~ 2006-07-22 12:11:31 +0400 +++ kdenetwork-3.5.4/lanbrowsing/lisa/main.cpp 2006-09-01 18:45:33 +0400 @@ -34,6 +34,7 @@ #include #include #include +#include // detect linux/glibc for the gnu style --args #if defined(__linux__) || defined(__linux) || defined(linux) @@ -259,15 +260,21 @@ int main(int argc, char** argv) //now dropping root privileges once and ever - setuid(getuid()); - if (geteuid() != getuid()) - _exit(255); + 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); dcerr<<"starting, dropped root privileges"< #include #include +#include // detect linux/glibc for the gnu style --args #if defined(__linux__) || defined(__linux) || defined(linux) @@ -235,13 +236,21 @@ int main(int argc, char** argv) //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); dcerr<<"starting, dropped root privileges"<