Displaying 10 results from an estimated 10 matches for "sh_load".
Did you mean:
shl_load
2019 Aug 02
1
Re: [nbdkit PATCH 2/3] sh: Avoid setenv after fork
...ir", tmpdir, 1);
> -
> execvp (argv[0], (char **) argv);
> perror (argv[0]);
> _exit (EXIT_FAILURE);
> diff --git a/plugins/sh/sh.c b/plugins/sh/sh.c
> index 737c38cf..e3d3c2f1 100644
> --- a/plugins/sh/sh.c
> +++ b/plugins/sh/sh.c
> @@ -60,6 +60,12 @@ sh_load (void)
> nbdkit_error ("mkdtemp: /tmp: %m");
> exit (EXIT_FAILURE);
> }
> + /* Set $tmpdir for the script. */
> + if (setenv ("tmpdir", tmpdir, 1) == -1) {
> + nbdkit_error ("setenv: tmpdir=%s: %m", tmpdir);
> + exit (EXIT_FAIL...
2019 Sep 05
2
[PATCH nbdkit] Ban use of stack Variable Length Arrays (VLAs).
...hen
- WARNINGS_CFLAGS="-Wall -Wshadow -Werror"
+ WARNINGS_CFLAGS="-Wall -Wshadow -Wvla -Werror"
AC_SUBST([WARNINGS_CFLAGS])
fi
diff --git a/plugins/sh/sh.c b/plugins/sh/sh.c
index c73b08b..acb50c4 100644
--- a/plugins/sh/sh.c
+++ b/plugins/sh/sh.c
@@ -74,8 +74,7 @@ sh_load (void)
static void
sh_unload (void)
{
- const size_t tmpdir_len = strlen (tmpdir);
- char cmd[7 + tmpdir_len + 1]; /* "rm -rf " + tmpdir + \0 */
+ CLEANUP_FREE char *cmd = NULL;
/* Run the unload method. Ignore all errors. */
if (script) {
@@ -85,8 +84,8 @@ sh_unload (void)...
2019 Aug 02
5
[nbdkit PATCH 0/3] sh plugin fixes
I'm pushing the first one as blatantly obvious.
The second one is also simple enough, but not enough of a bug for me
to push tonight.
The third is something I noticed while working on sh, but is really
more about docs vs. plugins in general. There, we could either change
the code to match the docs (breaking backwards behavior for a plugin
that set .errno_is_preserved=2) [what my patch did],
2019 Aug 02
0
[nbdkit PATCH 2/3] sh: Avoid setenv after fork
...ir for the script. */
- setenv ("tmpdir", tmpdir, 1);
-
execvp (argv[0], (char **) argv);
perror (argv[0]);
_exit (EXIT_FAILURE);
diff --git a/plugins/sh/sh.c b/plugins/sh/sh.c
index 737c38cf..e3d3c2f1 100644
--- a/plugins/sh/sh.c
+++ b/plugins/sh/sh.c
@@ -60,6 +60,12 @@ sh_load (void)
nbdkit_error ("mkdtemp: /tmp: %m");
exit (EXIT_FAILURE);
}
+ /* Set $tmpdir for the script. */
+ if (setenv ("tmpdir", tmpdir, 1) == -1) {
+ nbdkit_error ("setenv: tmpdir=%s: %m", tmpdir);
+ exit (EXIT_FAILURE);
+ }
+
nbdkit_debug ("...
2019 Sep 05
0
Re: [PATCH nbdkit] Ban use of stack Variable Length Arrays (VLAs).
...hat both gcc and clang are okay with our current list; we
may reach the point where we need to probe at configure time on which
options we can safely use, instead of merely open-coding a list, but
we'll deal with that when it breaks the build.
> +++ b/plugins/sh/sh.c
> @@ -74,8 +74,7 @@ sh_load (void)
> static void
> sh_unload (void)
> {
> - const size_t tmpdir_len = strlen (tmpdir);
> - char cmd[7 + tmpdir_len + 1]; /* "rm -rf " + tmpdir + \0 */
> + CLEANUP_FREE char *cmd = NULL;
>
> /* Run the unload method. Ignore all errors. */
> if...
2020 Apr 15
0
[PATCH nbdkit 8/9] eval, sh: Set $tmpdir before running the command, instead of globally.
...lugins/sh/sh.c
+++ b/plugins/sh/sh.c
@@ -50,7 +50,7 @@
#include "call.h"
#include "methods.h"
-static char tmpdir[] = "/tmp/nbdkitshXXXXXX";
+char tmpdir[] = "/tmp/nbdkitshXXXXXX";
static char *script;
static char *magic_config_key;
@@ -71,11 +71,6 @@ sh_load (void)
nbdkit_error ("mkdtemp: /tmp: %m");
exit (EXIT_FAILURE);
}
- /* Set $tmpdir for the script. */
- if (setenv ("tmpdir", tmpdir, 1) == -1) {
- nbdkit_error ("setenv: tmpdir=%s: %m", tmpdir);
- exit (EXIT_FAILURE);
- }
nbdkit_debug ("...
2020 Sep 21
0
[nbdkit PATCH v3 06/14] api: Add .export_description
...386 100644
--- a/plugins/sh/sh.c
+++ b/plugins/sh/sh.c
@@ -284,46 +284,47 @@ sh_config_complete (void)
#define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL
static struct nbdkit_plugin plugin = {
- .name = "sh",
- .version = PACKAGE_VERSION,
- .load = sh_load,
- .unload = sh_unload,
+ .name = "sh",
+ .version = PACKAGE_VERSION,
+ .load = sh_load,
+ .unload = sh_unload,
- .dump_plugin = sh_dump_plugin,
+ .dump_plugin = sh_dump_plugin,
- .config = sh_...
2020 Apr 15
18
[PATCH nbdkit 0/9] Generic vector, and pass $nbdkit_stdio_safe to shell scripts.
This was a rather longer trip around the houses than I anticipated!
The basic purpose of the patch series is to set $nbdkit_stdio_safe to
"0" or "1" in sh and eval plugin scripts.
To do that, I ended up adding a nicer way to manipulate environ lists,
and to do that, I ended up adding a whole generic vector
implementation which is applicable in a lot of different places.
2020 Aug 27
10
[nbdkit PATCH v2 0/8] exportname filter
This is a revision of my .default_export work, plus new work on
.export_descriptions and a new exportname filter. I think it is
now ready to check in.
Things I'd still like in 1.22:
- the file plugin should implement .list_exports (patch already posted,
but it needs rebasing on this series)
- the ext2 filter should override .list_exports when in exportname mode
- the nbd plugin should be
2020 Sep 21
18
[nbdkit PATCH v3 00/14] exportname filter
It's been several weeks since I posted v2 (I got distracted by
improving libnbd to better test things, which in turn surfaced some
major memory leak problems in nbdsh that are now fixed). Many of the
patches are minor rebases from v2, with the biggest changes being
fallout from:
- patch 2: rename nbdkit_add_default_export to nbdkit_use_default_export
- overall: this missed 1.22, so update