Use vfork()/execvp() instead of system().
[oweals/opkg-lede.git] / libopkg / pkg.c
index 78b6cadba1abef5c032fc5e15ea2b2a72df8737a..b0c2b69944129df17011c0222f14fe62a8ad6dcd 100644 (file)
@@ -1195,8 +1195,10 @@ int pkg_run_script(opkg_conf_t *conf, pkg_t *pkg,
 
      sprintf_alloc(&cmd, "%s %s", path, args);
      free(path);
-
-     err = xsystem(cmd);
+     {
+         const char *argv[] = {"sh", "-c", cmd, NULL};
+         err = xsystem(argv);
+     }
      free(cmd);
 
      if (err) {