]> www.tinc-vpn.org Git - tinc/blobdiff - src/script.c
GitHub CI: update list of container images
[tinc] / src / script.c
index 0b16c861d8e4d5930b306b7f3e2df4adde0ed0fe..2f2c30bf51a87f22739c8a9a78ff921273943753 100644 (file)
@@ -26,6 +26,7 @@
 #include "names.h"
 #include "script.h"
 #include "xalloc.h"
+#include "sandbox.h"
 
 #ifdef HAVE_PUTENV
 static void unputenv(const char *p) {
@@ -134,13 +135,17 @@ void environment_init(environment_t *env) {
 
 void environment_exit(environment_t *env) {
        for(int i = 0; i < env->n; i++) {
-               free(env->entries[i]);
+               free_string(env->entries[i]);
        }
 
        free(env->entries);
 }
 
 bool execute_script(const char *name, environment_t *env) {
+       if(!sandbox_can(START_PROCESSES, RIGHT_NOW)) {
+               return false;
+       }
+
        char scriptname[PATH_MAX];
        char *command;