]> gitweb @ CieloNegro.org - daemon.git/blobdiff - daemon.c
Done!
[daemon.git] / daemon.c
index 7fccad04b5e53594f766ef5d0252c0413275339c..82b19a1cb1e8ad31693de99ccfd4ca6ae2adb5bd 100644 (file)
--- a/daemon.c
+++ b/daemon.c
  *     From BSDI: daemon.c,v 1.2 1996/08/15 01:11:09 jch Exp
  */
 
-#include <sys/cdefs.h>
-__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 <sys/param.h>
 
 #include <err.h>
 #include <errno.h>
 #include <pwd.h>
-#include <libutil.h>
-#include <login_cap.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -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