#include "drop_privileges.h"
#include <pwd.h>
#include <unistd.h>
Functions |
int | drop_privileges (gchar *username, GError **error) |
| Naive attempt to drop privileges.
|
Detailed Description
Basic support to drop privileges.
Function Documentation
int drop_privileges |
( |
gchar * |
username, |
|
|
GError ** |
error |
|
) |
| |
Naive attempt to drop privileges.
We try to drop our (root) privileges and setuid to
- Parameters:
-
| username | to minimize the risk of privilege escalation. The current implementation is somewhat linux-specific and may not work on other platforms. |
[in] | username | The user to become. Its safe to pass "NULL", in which case it will default to "nobody". |
[out] | error | Return location for errors or NULL if not interested in errors. |
- Returns:
- OPENVAS_DROP_PRIVILEGES_OK in case of success. Sets
- Parameters:
-
error | otherwise and returns the error code. |