* 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>
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