aboutsummaryrefslogtreecommitdiffstats
path: root/src/starter/invokecharon.c
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2008-05-08 10:58:04 +0000
committerMartin Willi <martin@strongswan.org>2008-05-08 10:58:04 +0000
commit25b12c696bf52b7ddb228458bba656d25a6222d4 (patch)
tree6c9fa89a5fc25ac3923415901aa94a2448295769 /src/starter/invokecharon.c
parent97e820f5fdbd7987003cb086a02f7ee2f2a6ccee (diff)
downloadstrongswan-25b12c696bf52b7ddb228458bba656d25a6222d4.tar.bz2
strongswan-25b12c696bf52b7ddb228458bba656d25a6222d4.tar.xz
replaced --with-gid/uid by --with-group/user
using named users, groups fixed capability dropping in pluto
Diffstat (limited to 'src/starter/invokecharon.c')
-rw-r--r--src/starter/invokecharon.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/starter/invokecharon.c b/src/starter/invokecharon.c
index 477be1faa..ade71fc56 100644
--- a/src/starter/invokecharon.c
+++ b/src/starter/invokecharon.c
@@ -103,8 +103,8 @@ starter_stop_charon (void)
int
starter_start_charon (starter_config_t *cfg, bool debug)
{
- int pid, i;
struct stat stb;
+ int pid, i;
char buffer[BUF_LEN];
int argc = 1;
char *arg[] = {
@@ -159,34 +159,6 @@ starter_start_charon (starter_config_t *cfg, bool debug)
unlink(CHARON_CTL_FILE);
_stop_requested = 0;
- /* if ipsec.secrets file is missing then generate RSA default key pair */
- if (stat(SECRETS_FILE, &stb) != 0)
- {
- mode_t oldmask;
- FILE *f;
-
- plog("no %s file, generating RSA key", SECRETS_FILE);
- seteuid(IPSEC_UID);
- setegid(IPSEC_GID);
- system("ipsec scepclient --out pkcs1 --out cert-self --quiet");
- seteuid(0);
- setegid(0);
-
- /* ipsec.secrets is root readable only */
- oldmask = umask(0066);
-
- f = fopen(SECRETS_FILE, "w");
- if (f)
- {
- fprintf(f, "# /etc/ipsec.secrets - strongSwan IPsec secrets file\n");
- fprintf(f, "\n");
- fprintf(f, ": RSA myKey.der\n");
- fclose(f);
- }
- chown(SECRETS_FILE, IPSEC_UID, IPSEC_GID);
- umask(oldmask);
- }
-
pid = fork();
switch (pid)
{