X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=daemon.git;a=blobdiff_plain;f=daemon.c;fp=daemon.c;h=82b19a1cb1e8ad31693de99ccfd4ca6ae2adb5bd;hp=7fccad04b5e53594f766ef5d0252c0413275339c;hb=7162d53967117a8eda4257244327d63f95633783;hpb=0aa9138f10ceb0258291ce0945e207393c2fe4cc diff --git a/daemon.c b/daemon.c index 7fccad0..82b19a1 100644 --- a/daemon.c +++ b/daemon.c @@ -28,16 +28,14 @@ * From BSDI: daemon.c,v 1.2 1996/08/15 01:11:09 jch Exp */ -#include -__FBSDID("$FreeBSD: src/usr.sbin/daemon/daemon.c,v 1.8 2007/04/19 16:43:30 peter Exp $"); +#include "config.h" +#include "pidfile.h" #include #include #include #include -#include -#include #include #include #include @@ -127,8 +125,8 @@ restrict_process(const char *user) if (pw == NULL) errx(1, "unknown user: %s", user); - if (setusercontext(NULL, pw, pw->pw_uid, LOGIN_SETALL) != 0) - errx(1, "failed to set user environment"); + if (setuid(pw->pw_uid) != 0) + errx(1, "failed to setuid to %s", user); } static void