1 /* $OSSEC, privsep_op.h, v0.2, 2004/08/05, Daniel B. Cid$ */
3 /* Copyright (C) 2009 Trend Micro Inc.
6 * This program is a free software; you can redistribute it
7 * and/or modify it under the terms of the GNU General Public
8 * License (version 2) as published by the FSF - Free Software
12 /* Part of the OSSEC HIDS
13 * Available at http://www.ossec.net
16 /* Functions for privilege separation.
24 #include <sys/types.h>
27 #include "headers/os_err.h"
29 int Privsep_GetUser(char * name)
38 os_uid = (int)pw->pw_uid;
44 int Privsep_GetGroup(char * name)
53 os_gid = (int)grp->gr_gid;
59 int Privsep_SetUser(uid_t uid)
72 int Privsep_SetGroup(gid_t gid)
74 if (setgroups(1, &gid) == -1)
88 int Privsep_Chroot(char * path)