lifecycle: Make sure to return true when script dir doesn't exist.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
This commit is contained in:
parent
61ed18db2c
commit
570679c5bf
1 changed files with 2 additions and 1 deletions
|
@ -246,12 +246,13 @@ lif_lifecycle_run_phase(const struct lif_execute_opts *opts, struct lif_interfac
|
||||||
snprintf (dir_path, 4096, "/etc/network/if-%s.d", phase);
|
snprintf (dir_path, 4096, "/etc/network/if-%s.d", phase);
|
||||||
|
|
||||||
if (stat (dir_path, &dir_stat) != 0 || S_ISDIR (dir_stat.st_mode) == 0) {
|
if (stat (dir_path, &dir_stat) != 0 || S_ISDIR (dir_stat.st_mode) == 0) {
|
||||||
goto handle_error;
|
goto out_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we should do error handling here, but ifupdown1 doesn't */
|
/* we should do error handling here, but ifupdown1 doesn't */
|
||||||
lif_execute_fmt(opts, envp, "/bin/run-parts %s", dir_path);
|
lif_execute_fmt(opts, envp, "/bin/run-parts %s", dir_path);
|
||||||
|
|
||||||
|
out_free:
|
||||||
lif_environment_free(&envp);
|
lif_environment_free(&envp);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue