diff options
author | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2008-12-05 16:15:54 +0000 |
---|---|---|
committer | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2008-12-05 16:15:54 +0000 |
commit | c7f1b0530b85bc7654e68992f25ed8ced5d0a80d (patch) | |
tree | 861798cd7da646014ed6919766b053099646710d /src/dumm/dumm.c | |
parent | 8b80ab5a6950ce6515f477624794defd7531642a (diff) | |
download | vyos-strongswan-c7f1b0530b85bc7654e68992f25ed8ced5d0a80d.tar.gz vyos-strongswan-c7f1b0530b85bc7654e68992f25ed8ced5d0a80d.zip |
[svn-upgrade] Integrating new upstream version, strongswan (4.2.9)
Diffstat (limited to 'src/dumm/dumm.c')
-rw-r--r-- | src/dumm/dumm.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/dumm/dumm.c b/src/dumm/dumm.c index eaefddb60..cf8d9719c 100644 --- a/src/dumm/dumm.c +++ b/src/dumm/dumm.c @@ -87,7 +87,7 @@ static void delete_guest(private_dumm_t *this, guest_t *guest) guest->destroy(guest); if (len > 8 && len < 512) { - system(buf); + ignore_result(system(buf)); } } } @@ -280,7 +280,10 @@ dumm_t *dumm_create(char *dir) } if (dir) { - asprintf(&this->dir, "%s/%s", cwd, dir); + if (asprintf(&this->dir, "%s/%s", cwd, dir) < 0) + { + this->dir = NULL; + } } else { @@ -288,17 +291,21 @@ dumm_t *dumm_create(char *dir) } } this->template = NULL; - asprintf(&this->guest_dir, "%s/%s", this->dir, GUEST_DIR); + if (asprintf(&this->guest_dir, "%s/%s", this->dir, GUEST_DIR) < 0) + { + this->guest_dir = NULL; + } this->guests = linked_list_create(); this->bridges = linked_list_create(); - if (mkdir(this->guest_dir, PERME) < 0 && errno != EEXIST) + if (this->dir == NULL || this->guest_dir == NULL || + (mkdir(this->guest_dir, PERME) < 0 && errno != EEXIST)) { DBG1("creating guest directory '%s' failed: %m", this->guest_dir); destroy(this); return NULL; } - + load_guests(this); return &this->public; } |