Displaying 7 results from an estimated 7 matches for "reflection_open".
2019 Sep 15
0
[PATCH nbdkit 4/4] reflection: Enhance plugin to support client address mode.
...because it has to parse data sent
@@ -147,12 +222,16 @@ decode_base64 (const char *data, size_t len, struct handle *ret)
* - Inputs that result in unbounded output.
*
* - Inputs that could hang, crash or exploit the server.
+ *
+ * - Leaking host information (eg. paths).
*/
static void *
reflection_open (int readonly)
{
const char *export_name;
size_t export_name_len;
+ struct sockaddr_storage addr;
+ socklen_t addrlen;
struct handle *h;
h = malloc (sizeof *h);
@@ -189,6 +268,15 @@ reflection_open (int readonly)
return h;
}
+ case MODE_ADDRESS:
+ addrlen = sizeof...
2019 Sep 28
0
[PATCH nbdkit v2 2/4] Rename nbdkit-reflection-plugin to nbdkit-info-plugin.
...void)
+info_dump_plugin (void)
{
#ifdef HAVE_BASE64
- printf ("reflection_base64=yes\n");
+ printf ("info_base64=yes\n");
#endif
}
@@ -228,7 +228,7 @@ handle_address (struct sockaddr *sa, socklen_t addrlen,
* - Leaking host information (eg. paths).
*/
static void *
-reflection_open (int readonly)
+info_open (int readonly)
{
const char *export_name;
size_t export_name_len;
@@ -286,7 +286,7 @@ reflection_open (int readonly)
/* Close the per-connection handle. */
static void
-reflection_close (void *handle)
+info_close (void *handle)
{
struct handle *h = handle;...
2019 Sep 28
2
[PATCH nbdkit 1/2] common/include: Add function for subtracting struct timeval.
---
common/include/test-tvdiff.c | 75 +++++++++++++++++++++++++++++-------
common/include/tvdiff.h | 13 ++++++-
2 files changed, 74 insertions(+), 14 deletions(-)
diff --git a/common/include/test-tvdiff.c b/common/include/test-tvdiff.c
index 9cbcfc0..abefb2e 100644
--- a/common/include/test-tvdiff.c
+++ b/common/include/test-tvdiff.c
@@ -36,7 +36,6 @@
#include <stdlib.h>
#include
2019 Sep 15
0
[PATCH nbdkit 1/4] Add reflection plugin.
...nusual plugin because it has to parse data sent
+ * by the client. For security reasons, be careful about:
+ *
+ * - Returning more data than is sent by the client.
+ *
+ * - Inputs that result in unbounded output.
+ *
+ * - Inputs that could hang, crash or exploit the server.
+ */
+static void *
+reflection_open (int readonly)
+{
+ const char *export_name;
+ size_t export_name_len;
+ struct handle *h;
+
+ h = malloc (sizeof *h);
+ if (h == NULL) {
+ nbdkit_error ("malloc: %m");
+ return NULL;
+ }
+
+ switch (mode) {
+ case MODE_EXPORTNAME:
+ case MODE_BASE64EXPORTNAME:
+ export_...
2019 Sep 28
0
[PATCH nbdkit 2/2] reflection: Add mode for reflecting server time.
...@ -105,6 +127,7 @@ reflection_dump_plugin (void)
struct handle {
void *data; /* Block device data. */
size_t len; /* Length of data in bytes. */
+ struct timeval conn_t; /* Time since connection was opened. */
};
static int
@@ -279,6 +302,19 @@ reflection_open (int readonly)
}
return h;
+ case MODE_TIME:
+ case MODE_UPTIME:
+ case MODE_CONNTIME:
+ gettimeofday (&h->conn_t, NULL);
+ h->len = 12;
+ h->data = malloc (h->len);
+ if (h->data == NULL) {
+ nbdkit_error ("malloc: %m");
+ free (h);...
2019 Sep 15
13
[PATCH nbdkit 0/4] Reflection plugin, peer name.
This series is based on my blog posting here:
https://rwmj.wordpress.com/2019/09/13/nbdkit-supports-exportnames/
It depends on the fix for realloc:
https://www.redhat.com/archives/libguestfs/2019-September/thread.html#00103
This series adds a fun plugin, and also an semi-related feature I've
long thought to be desirable. You can consider patches 1 & 4, and
patches 2 & 3 as forming
2019 Sep 28
9
[PATCH nbdkit v2 0/4] info: Add mode for sending back server time.
v1 was:
https://www.redhat.com/archives/libguestfs/2019-September/thread.html#00361
v2:
- Adds a patch to rename the reflection plugin to the info plugin.
- Adds tests.
Rich.