OpenVAS Libraries  9.0.1
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
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
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 #define OPENVAS_DROP_PRIVILEGES_FAIL_SUPPLEMENTARY 5
46 
47 int drop_privileges (gchar * username, GError ** error);
48 
49 #endif
int drop_privileges(gchar *username, GError **error)
Naive attempt to drop privileges.
Definition: drop_privileges.c:79