Displaying 17 results from an estimated 17 matches for "get_socket_activation".
2018 Sep 08
0
[PATCH nbdkit v2 2/6] main: Tighten up characters permitted in config keys.
...L</FILENAMES AND PATHS> above.
diff --git a/src/main.c b/src/main.c
index 9c18d6f..c523854 100644
--- a/src/main.c
+++ b/src/main.c
@@ -72,6 +72,7 @@ static void fork_into_background (void);
static uid_t parseuser (const char *);
static gid_t parsegroup (const char *);
static unsigned int get_socket_activation (void);
+static int is_config_key (const char *key, size_t len);
struct debug_flag *debug_flags; /* -D */
int exit_with_parent; /* --exit-with-parent */
@@ -694,7 +695,7 @@ main (int argc, char *argv[])
magic_config_key = backend->magic_config_key (backend);
for (i = 0; optin...
2018 Sep 10
0
[PATCH nbdkit v3 2/6] main: Tighten up characters permitted in config keys.
...L</FILENAMES AND PATHS> above.
diff --git a/src/main.c b/src/main.c
index 9c18d6f..f4a800f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -72,6 +72,7 @@ static void fork_into_background (void);
static uid_t parseuser (const char *);
static gid_t parsegroup (const char *);
static unsigned int get_socket_activation (void);
+static int is_config_key (const char *key, size_t len);
struct debug_flag *debug_flags; /* -D */
int exit_with_parent; /* --exit-with-parent */
@@ -694,7 +695,7 @@ main (int argc, char *argv[])
magic_config_key = backend->magic_config_key (backend);
for (i = 0; optin...
2017 Jan 31
0
[PATCH nbdkit] Add support for socket activation.
...dom_fifo (void);
static void open_plugin_so (const char *filename);
static void start_serving (void);
@@ -64,6 +66,7 @@ static void write_pidfile (void);
static void fork_into_background (void);
static uid_t parseuser (const char *);
static gid_t parsegroup (const char *);
+static unsigned int get_socket_activation (void);
const char *exportname; /* -e */
int foreground; /* -f */
@@ -77,6 +80,7 @@ int listen_stdin; /* -s */
char *unixsocket; /* -U */
const char *user, *group; /* -u & -g */
int verbose; /* -v */
+unsigned i...
2019 Apr 23
0
[nbdkit PATCH 1/4] cleanup: Move cleanup.c to common
...c 100644
--- a/server/internal.h
+++ b/server/internal.h
@@ -42,6 +42,7 @@
#define NBDKIT_API_VERSION 2
#include "nbdkit-plugin.h"
#include "nbdkit-filter.h"
+#include "cleanup.h"
#ifdef __APPLE__
#define UNIX_PATH_MAX 104
@@ -135,17 +136,6 @@ extern unsigned int get_socket_activation (void);
/* usergroup.c */
extern void change_user (void);
-/* cleanup.c */
-extern void cleanup_free (void *ptr);
-#define CLEANUP_FREE __attribute__((cleanup (cleanup_free)))
-extern void cleanup_extents_free (void *ptr);
-#define CLEANUP_EXTENTS_FREE __attribute__((cleanup (cleanup_extents_fre...
2019 Sep 23
0
Re: [PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...sing anywhere that sizes are intended?
But the code looks correct if you want to keep it.
> diff --git a/server/socket-activation.c b/server/socket-activation.c
> index b9db67c..50df4ca 100644
> --- a/server/socket-activation.c
> +++ b/server/socket-activation.c
> @@ -59,11 +59,8 @@ get_socket_activation (void)
> s = getenv ("LISTEN_PID");
> if (s == NULL)
> return 0;
> - if (sscanf (s, "%u", &pid) != 1) {
> - fprintf (stderr, "%s: malformed %s environment variable (ignored)\n",
> - program_name, "LISTEN_PID");...
2019 Sep 21
2
[PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...L;
+}
+
/* Parse a string as a size with possible scaling suffix, or return -1
* after reporting the error.
*/
diff --git a/server/socket-activation.c b/server/socket-activation.c
index b9db67c..50df4ca 100644
--- a/server/socket-activation.c
+++ b/server/socket-activation.c
@@ -59,11 +59,8 @@ get_socket_activation (void)
s = getenv ("LISTEN_PID");
if (s == NULL)
return 0;
- if (sscanf (s, "%u", &pid) != 1) {
- fprintf (stderr, "%s: malformed %s environment variable (ignored)\n",
- program_name, "LISTEN_PID");
+ if (nbdkit_parse_unsigned...
2019 Apr 23
8
[nbdkit PATCH 0/4] Start using cleanup macros in filters/plugins
There's more that can be done (in particular, use of CLEANUP_FREE),
but this is enough to at least see if I'm on the right track.
I couldn't figure out an obvious difference between common/include and
common/utils, but it looks like the former is for things that are
inlineable via .h only, while the latter is when you need to link in
a convenience library, so this landed in the
2019 Sep 23
2
Re: [PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...hill, but I think there is
some use for all of these functions.
> > diff --git a/server/socket-activation.c b/server/socket-activation.c
> > index b9db67c..50df4ca 100644
> > --- a/server/socket-activation.c
> > +++ b/server/socket-activation.c
> > @@ -59,11 +59,8 @@ get_socket_activation (void)
> > s = getenv ("LISTEN_PID");
> > if (s == NULL)
> > return 0;
> > - if (sscanf (s, "%u", &pid) != 1) {
> > - fprintf (stderr, "%s: malformed %s environment variable (ignored)\n",
> > - program_...
2019 Jan 01
2
[PATCH nbdkit] server: Use bool for types which are really booleans.
...r/main.c
index e8a15f7..5e538bf 100644
--- a/server/main.c
+++ b/server/main.c
@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <stdbool.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
@@ -75,26 +76,26 @@ static unsigned int get_socket_activation (void);
static int is_config_key (const char *key, size_t len);
struct debug_flag *debug_flags; /* -D */
-int exit_with_parent; /* --exit-with-parent */
+bool exit_with_parent; /* --exit-with-parent */
const char *exportname; /* -e */
-int foreground;...
2020 Aug 15
3
[PATCH EXPERIMENTAL nbdkit 0/2] Port to Windows using mingw.
The patches following do indeed allow you to compile nbdkit.exe, but
it does not actually work yet. I'm posting this experimental series
more as a work in progress and to get feedback.
Note this does not require Windows itself to build or test. You can
cross-compile it using mingw64-* packages on Fedora or Debian, and
test it [spoiler alert: it fails] using Wine.
Rich.
2019 Sep 23
2
[PATCH nbdkit v2] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...L;
+}
+
/* Parse a string as a size with possible scaling suffix, or return -1
* after reporting the error.
*/
diff --git a/server/socket-activation.c b/server/socket-activation.c
index b9db67c..50df4ca 100644
--- a/server/socket-activation.c
+++ b/server/socket-activation.c
@@ -59,11 +59,8 @@ get_socket_activation (void)
s = getenv ("LISTEN_PID");
if (s == NULL)
return 0;
- if (sscanf (s, "%u", &pid) != 1) {
- fprintf (stderr, "%s: malformed %s environment variable (ignored)\n",
- program_name, "LISTEN_PID");
+ if (nbdkit_parse_unsigned...
2018 Nov 29
6
[nbdkit PATCH 0/3] Fix %m usage on BSD
Our use of "%m" in various error messages is testament to the
project's initial life on Linux - but other than Cygwin, I know
of no other platforms supporting that glibc extension.
We COULD audit the code and manually turn "%m" into
"%s"/strerror(errno), but that's a lot of churn. Instead, let's
fix the few outliers that can't be easily wrapped, then
2019 Jan 14
6
[PATCH nbdkit incomplete 0/5] Port to Windows.
This is an incomplete port to Windows. Currently the server compiles
and starts up successfully, but goes into an infinite loop when you
connect to it. Nevertheless I think the approach is ready for
feedback. This being Windows the changes go quite deep.
Rich.
2018 Sep 08
8
[PATCH nbdkit v2 0/6] plugins: Implement magic config key.
v1 was here:
https://www.redhat.com/archives/libguestfs/2018-September/msg00024.html
v2:
- As discussed in the patch review, tighten up the characters
permitted in keys.
- Update documentation to note that relative paths can be made
safe by prefixing with ./ and absolute paths do not need any
extra steps.
- I pushed patch 1/6 from the v1 series since it was just a trivial
2018 Sep 10
7
[PATCH nbdkit v3 0/6] plugins: Implement magic config key.
v1: https://www.redhat.com/archives/libguestfs/2018-September/msg00024.html
v2: https://www.redhat.com/archives/libguestfs/2018-September/msg00034.html
v3:
- Fixed is_config_key zero length test.
- Fixed is_config_key so it uses strspn and is not O(n^2).
- Changed >= 1.7 to >= 1.8 in the documentation.
Rich.
2020 Aug 18
15
[PATCH nbdkit 0/9] Port to Windows.
Also available here:
https://github.com/rwmjones/nbdkit/tree/2020-windows-mingw
This is the port to Windows using native Windows APIs (not MSYS or
Cygwin).
This patch series is at the point where it basically now works. I can
run the server with the memory plugin, and access it remotely using
guestfish, creating filesystems and so on without any apparent
problems.
Nevertheless there are many
2020 Aug 20
15
[PATCH nbdkit 0/13] Port to Windows without using a separate library.
Also available here:
https://github.com/rwmjones/nbdkit/tree/2020-windows-mingw-nolib
After a lot of work I have made the port to Windows work without using
a separate library. Instead, on Windows only, we build an "import
library" (library of stubs) which resolves references to nbdkit_*
functions in the main program and fixes up the plugin, basically the
first technique outlined in