OpenVAS Libraries  6.0+beta5
drop_privileges.h
Go to the documentation of this file.
1 /* openvas-libraries/base
2  * $Id$
3  * Description: Privilege dropping header file.
4  *
5  * Authors:
6  * Felix Wolfsteller <felix.wolfsteller@intevation.de>
7  * based on work by Michael Wiegand <michael.wiegand@intevation.de>
8  *
9  * Copyright:
10  * Copyright (C) 2010 Greenbone Networks GmbH
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License version 2,
14  * or, at your option, any later version as published by the Free
15  * Software Foundation
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
25  */
26 
27 #ifndef _OPENVAS_LIBRARIES_BASE_DROP_PRIVILEGES_H
28 #define _OPENVAS_LIBRARIES_BASE_DROP_PRIVILEGES_H
29 
30 #include <glib.h>
31 
35 #define OPENVAS_DROP_PRIVILEGES g_quark_from_static_string ("openvas-drop-privileges-error-quark")
36 
37 /* Definitions of the return codes. */
38 #define OPENVAS_DROP_PRIVILEGES_ERROR_ALREADY_SET -1
39 
40 #define OPENVAS_DROP_PRIVILEGES_OK 0
41 #define OPENVAS_DROP_PRIVILEGES_FAIL_NOT_ROOT 1
42 #define OPENVAS_DROP_PRIVILEGES_FAIL_UNKNOWN_USER 2
43 #define OPENVAS_DROP_PRIVILEGES_FAIL_DROP_GID 3
44 #define OPENVAS_DROP_PRIVILEGES_FAIL_DROP_UID 4
45 
46 int drop_privileges (gchar * username, GError ** error);
47 
48 #endif