lifecycle: if lif_config.allow_addon_scripts is disabled, don't run addon scripts
This commit is contained in:
parent
c1c9115e5d
commit
4b30dc4573
1 changed files with 5 additions and 0 deletions
|
@ -25,6 +25,7 @@
|
||||||
#include "libifupdown/lifecycle.h"
|
#include "libifupdown/lifecycle.h"
|
||||||
#include "libifupdown/state.h"
|
#include "libifupdown/state.h"
|
||||||
#include "libifupdown/tokenize.h"
|
#include "libifupdown/tokenize.h"
|
||||||
|
#include "libifupdown/config-file.h"
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
handle_commands_for_phase(const struct lif_execute_opts *opts, char *const envp[], const struct lif_interface *iface, const char *phase)
|
handle_commands_for_phase(const struct lif_execute_opts *opts, char *const envp[], const struct lif_interface *iface, const char *phase)
|
||||||
|
@ -240,6 +241,10 @@ lif_lifecycle_run_phase(const struct lif_execute_opts *opts, struct lif_interfac
|
||||||
if (!handle_commands_for_phase(opts, envp, iface, phase))
|
if (!handle_commands_for_phase(opts, envp, iface, phase))
|
||||||
goto handle_error;
|
goto handle_error;
|
||||||
|
|
||||||
|
/* if we don't need to support /etc/if-X.d we're done here */
|
||||||
|
if (!lif_config.allow_addon_scripts)
|
||||||
|
goto out_free;
|
||||||
|
|
||||||
/* Check if scripts dir for this phase is present and bail out if it isn't */
|
/* Check if scripts dir for this phase is present and bail out if it isn't */
|
||||||
struct stat dir_stat;
|
struct stat dir_stat;
|
||||||
char dir_path[4096];
|
char dir_path[4096];
|
||||||
|
|
Loading…
Reference in a new issue