changing UID/GID after startup of pluto/charon

added --with-uid/--with-gid configure option
This commit is contained in:
Martin Willi
2007-05-07 12:38:46 +00:00
parent a4a3884c83
commit 6874bf698c
16 changed files with 113 additions and 57 deletions
+8 -8
View File
@@ -332,8 +332,6 @@ typedef struct daemon_t daemon_t;
*/
#define SECRETS_FILE CONFIG_DIR "/ipsec.secrets"
#define IPSEC_USER "nobody"
/**
* @brief Main class of daemon, contains some globals.
*
@@ -423,17 +421,19 @@ struct daemon_t {
/**
* @brief Let the calling thread drop its capabilities.
*
* @param this calling daemon
* @param netlink TRUE to keep CAP_NET_ADMIN (using netlink)
* @param bind TRUE to keep CAP_NET_BIND_SERVICE and CAP_NET_RAW
* @param this calling daemon
* @param change_uid TRUE to change UID/GID to IPSEC_UID/IPSEC_GID
* @param netlink TRUE to keep CAP_NET_ADMIN (using netlink)
* @param bind TRUE to keep CAP_NET_BIND_SERVICE and CAP_NET_RAW
*/
void (*drop_capabilities) (daemon_t *this, bool netlink, bool bind);
void (*drop_capabilities) (daemon_t *this, bool change_uid,
bool netlink, bool bind);
/**
* @brief Shut down the daemon.
*
* @param this the daemon to kill
* @param reason describtion why it will be killed
* @param this the daemon to kill
* @param reason describtion why it will be killed
*/
void (*kill) (daemon_t *this, char *reason);
};