Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libnbd for openSUSE:Factory checked 
in at 2026-02-18 17:06:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libnbd (Old)
 and      /work/SRC/openSUSE:Factory/.libnbd.new.1977 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libnbd"

Wed Feb 18 17:06:41 2026 rev:26 rq:1333634 version:1.24.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/libnbd/libnbd.changes    2026-01-20 
21:02:38.043311505 +0100
+++ /work/SRC/openSUSE:Factory/.libnbd.new.1977/libnbd.changes  2026-02-18 
17:07:36.203151681 +0100
@@ -1,0 +2,19 @@
+Tue Feb 17 14:19:04 UTC 2026 - Charles Arnold <[email protected]>
+
+- Update to version 1.24.1: (jsc#PED-14625)
+  * Version 1.24.1.
+  * tests/socket-activation-name.c: Fix test for nbdkit >= 1.47.5
+  * lib/utils.c: Fix whitespace
+  * fuse/operations.c: Remove out of date comment
+  * tests/aio-connect-port.c: Delete this test
+  * tests/aio-connect-port.c: Replace broken link in comment
+  * configure.ac: Remove use of "which" command
+  * info/nbdinfo.pod: Document what --can connect actually does
+  * info: Split nbdinfo --is tls into separate test
+  * info: Don't check for nbdkit --no-sr flag in tests that don't use it
+  * lib/lib/test-fork-safe: Use set -x
+  * generator: Link from nbd_connect_uri to nbdkit-ssh-plugin
+  * docs/libnbd-security.pod: Document CVE-2025-14946
+  * docs/libnbd-release-notes-1.24.pod: Fix typo in C<> markup
+
+-------------------------------------------------------------------

Old:
----
  libnbd-1.24.0.tar.bz2

New:
----
  libnbd-1.24.1.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libnbd.spec ++++++
--- /var/tmp/diff_new_pack.c421GJ/_old  2026-02-18 17:07:36.891180318 +0100
+++ /var/tmp/diff_new_pack.c421GJ/_new  2026-02-18 17:07:36.895180485 +0100
@@ -19,7 +19,7 @@
 %define sover 0
 
 Name:           libnbd
-Version:        1.24.0
+Version:        1.24.1
 Release:        0
 Summary:        NBD client library in userspace
 License:        LGPL-2.1-or-later

++++++ _service ++++++
--- /var/tmp/diff_new_pack.c421GJ/_old  2026-02-18 17:07:36.931181983 +0100
+++ /var/tmp/diff_new_pack.c421GJ/_new  2026-02-18 17:07:36.931181983 +0100
@@ -1,7 +1,7 @@
 <services>
   <service name="tar_scm" mode="manual">
     <param name="filename">libnbd</param>
-    <param name="revision">v1.24.0</param>
+    <param name="revision">v1.24.1</param>
     <param name="scm">git</param>
     <param name="submodules">disable</param>
     <param name="url">https://gitlab.com/nbdkit/libnbd.git</param>

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.c421GJ/_old  2026-02-18 17:07:36.967183481 +0100
+++ /var/tmp/diff_new_pack.c421GJ/_new  2026-02-18 17:07:36.979183981 +0100
@@ -1,6 +1,6 @@
 <servicedata>
 <service name="tar_scm">
                 <param name="url">https://gitlab.com/nbdkit/libnbd.git</param>
-              <param 
name="changesrevision">7df1ebd896ccccbb4ae7bdcdd4580fa16a708eb6</param></service></servicedata>
+              <param 
name="changesrevision">30e87bb3455e10ed36ff05daa48f407e8f1c958c</param></service></servicedata>
 (No newline at EOF)
 

++++++ libnbd-1.24.0.tar.bz2 -> libnbd-1.24.1.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libnbd-1.24.0/configure.ac 
new/libnbd-1.24.1/configure.ac
--- old/libnbd-1.24.0/configure.ac      2025-12-16 11:59:53.000000000 +0100
+++ new/libnbd-1.24.1/configure.ac      2026-02-17 12:50:23.000000000 +0100
@@ -15,7 +15,7 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
-AC_INIT([libnbd],[1.24.0])
+AC_INIT([libnbd],[1.24.1])
 
 AC_CONFIG_MACRO_DIR([m4])
 
@@ -432,7 +432,7 @@
 dnl Bash must be at least version 4.  If it is too old, fail hard
 dnl with a good diagnostic.  Note macOS ships an ancient version
 dnl of bash (https://gitlab.com/nbdkit/nbdkit/-/issues/21)
-bash=`which bash`
+bash=$(command -v bash)
 AC_MSG_CHECKING([for the major version of $bash])
 bash_major=`bash -c 'echo ${BASH_VERSINFO:-0}'`
 AC_MSG_RESULT([$bash_major])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libnbd-1.24.0/docs/libnbd-release-notes-1.24.pod 
new/libnbd-1.24.1/docs/libnbd-release-notes-1.24.pod
--- old/libnbd-1.24.0/docs/libnbd-release-notes-1.24.pod        2025-12-16 
11:59:53.000000000 +0100
+++ new/libnbd-1.24.1/docs/libnbd-release-notes-1.24.pod        2026-02-17 
12:50:23.000000000 +0100
@@ -124,7 +124,7 @@
 
 Copy new vector and string functions from nbdkit, including
 C<vector_uniq>, C<vector_append_array>, C<vector_insert_array>,
-C,vector_remove_range>, C<string_append_format>.
+C<vector_remove_range>, C<string_append_format>.
 
 Fix the memory allocation behaviour of the internal vector library,
 which should reduce memory usage in some situations (Eric Blake).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libnbd-1.24.0/docs/libnbd-security.pod 
new/libnbd-1.24.1/docs/libnbd-security.pod
--- old/libnbd-1.24.0/docs/libnbd-security.pod  2025-12-16 11:59:53.000000000 
+0100
+++ new/libnbd-1.24.1/docs/libnbd-security.pod  2026-02-17 12:50:23.000000000 
+0100
@@ -57,7 +57,8 @@
 See the full announcement here:
 
L<https://lists.libguestfs.org/archives/list/[email protected]/thread/LHR3BW6RJ7K4BJBQIYV3GTZLSY27VZO2/>
 
-=head2 unsanitized hostnames in nbd+ssh URIs allow remote execution
+=head2 CVE-2025-14946
+unsanitized hostnames in nbd+ssh URIs allow remote execution
 
 See the full announcement here:
 
L<https://lists.libguestfs.org/archives/list/[email protected]/thread/YZMBF3SJRWTRVT5L3KWSNHITFTRMQNTT/>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libnbd-1.24.0/fuse/operations.c 
new/libnbd-1.24.1/fuse/operations.c
--- old/libnbd-1.24.0/fuse/operations.c 2025-12-16 11:59:53.000000000 +0100
+++ new/libnbd-1.24.1/fuse/operations.c 2026-02-17 12:50:23.000000000 +0100
@@ -473,9 +473,6 @@
       return 0;
     }
   }
-  /* As of FUSE 35 this is not supported by the kernel module and it
-   * always returns EOPNOTSUPP.
-   */
   else if (mode & FALLOC_FL_ZERO_RANGE) {
     /* If the backend doesn't support writing zeroes then we can
      * emulate it.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libnbd-1.24.0/generator/API.ml 
new/libnbd-1.24.1/generator/API.ml
--- old/libnbd-1.24.0/generator/API.ml  2025-12-16 11:59:53.000000000 +0100
+++ new/libnbd-1.24.1/generator/API.ml  2026-02-17 12:50:23.000000000 +0100
@@ -2269,6 +2269,7 @@
                 Link "set_export_name"; Link "set_tls";
                 Link "set_opt_mode"; Link "get_uri"; Link "is_uri";
                 Link "supports_vsock"; Link "supports_uri";
+                ExternalLink ("nbdkit-ssh-plugin", 1);
                 ExternalLink ("vsock", 7)];
   };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libnbd-1.24.0/info/Makefile.am 
new/libnbd-1.24.1/info/Makefile.am
--- old/libnbd-1.24.0/info/Makefile.am  2025-12-16 11:59:53.000000000 +0100
+++ new/libnbd-1.24.1/info/Makefile.am  2026-02-17 12:50:23.000000000 +0100
@@ -27,6 +27,7 @@
        info-cmd-map-totals.sh \
        info-cmd-size.sh \
        info-is-read-only.sh \
+       info-is-tls.sh \
        info-list.sh \
        info-list-json.sh \
        info-list-qemu.sh \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libnbd-1.24.0/info/info-can-connect.sh 
new/libnbd-1.24.1/info/info-can-connect.sh
--- old/libnbd-1.24.0/info/info-can-connect.sh  2025-12-16 11:59:53.000000000 
+0100
+++ new/libnbd-1.24.1/info/info-can-connect.sh  2026-02-17 12:50:23.000000000 
+0100
@@ -23,14 +23,7 @@
 
 # --can connect always returns true.
 
-requires $NBDKIT --no-sr null --version
+requires $NBDKIT null --version
 
 $NBDKIT -v -U - null \
         --run '$VG nbdinfo --can connect "nbd+unix:///?socket=$unixsocket"'
-
-# --is tls is false for unencrypted connections.
-
-st=0
-$NBDKIT -v -U - null \
-        --run '$VG nbdinfo --is tls "nbd+unix:///?socket=$unixsocket"' || st=$?
-test $st = 2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libnbd-1.24.0/info/info-can.sh 
new/libnbd-1.24.1/info/info-can.sh
--- old/libnbd-1.24.0/info/info-can.sh  2025-12-16 11:59:53.000000000 +0100
+++ new/libnbd-1.24.1/info/info-can.sh  2026-02-17 12:50:23.000000000 +0100
@@ -26,7 +26,7 @@
 
 # --is read-only and --can write are tested in info-is-read-only.sh
 
-# --is tls is tested in info-uri-nbds.sh and info-can-connect.sh
+# --is tls is tested in info-uri-nbds.sh and info-is-tls.sh
 
 # --can connect is tested in info-can-connect.sh
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libnbd-1.24.0/info/info-is-tls.sh 
new/libnbd-1.24.1/info/info-is-tls.sh
--- old/libnbd-1.24.0/info/info-is-tls.sh       1970-01-01 01:00:00.000000000 
+0100
+++ new/libnbd-1.24.1/info/info-is-tls.sh       2026-02-17 12:50:23.000000000 
+0100
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+# nbd client library in userspace
+# Copyright Red Hat
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+. ../tests/functions.sh
+
+set -e
+set -x
+
+# --is tls is false for unencrypted connections.
+# The positive case is tested separately in info-uri-nbds.sh.
+
+requires $NBDKIT null --version
+
+st=0
+$NBDKIT -v -U - null \
+        --run '$VG nbdinfo --is tls "nbd+unix:///?socket=$unixsocket"' || st=$?
+test $st = 2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libnbd-1.24.0/info/nbdinfo.pod 
new/libnbd-1.24.1/info/nbdinfo.pod
--- old/libnbd-1.24.0/info/nbdinfo.pod  2025-12-16 11:59:53.000000000 +0100
+++ new/libnbd-1.24.1/info/nbdinfo.pod  2026-02-17 12:50:23.000000000 +0100
@@ -171,7 +171,9 @@
 
 =item nbdinfo --can connect URI
 
-Test if we can connect to the NBD URI.
+Test if we can connect to the NBD URI.  This tests the NBD handshake
+as far as NBD options processing, but does not guarantee that the
+export can be opened.
 
 =item nbdinfo --is tls URI
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libnbd-1.24.0/lib/test-fork-safe-assert.sh 
new/libnbd-1.24.1/lib/test-fork-safe-assert.sh
--- old/libnbd-1.24.0/lib/test-fork-safe-assert.sh      2025-12-16 
11:59:53.000000000 +0100
+++ new/libnbd-1.24.1/lib/test-fork-safe-assert.sh      2026-02-17 
12:50:23.000000000 +0100
@@ -16,6 +16,8 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
+set -x
+
 set +e
 
 ./test-fork-safe-assert 2>test-fork-safe-assert.err
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libnbd-1.24.0/lib/test-fork-safe-execvpe.sh 
new/libnbd-1.24.1/lib/test-fork-safe-execvpe.sh
--- old/libnbd-1.24.0/lib/test-fork-safe-execvpe.sh     2025-12-16 
11:59:53.000000000 +0100
+++ new/libnbd-1.24.1/lib/test-fork-safe-execvpe.sh     2026-02-17 
12:50:23.000000000 +0100
@@ -19,6 +19,7 @@
 . ../tests/functions.sh
 
 set -e
+set -x
 
 # The "realpath" utility is not in POSIX, but Linux, FreeBSD and
 # OpenBSD all have it.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libnbd-1.24.0/lib/utils.c 
new/libnbd-1.24.1/lib/utils.c
--- old/libnbd-1.24.0/lib/utils.c       2025-12-16 11:59:53.000000000 +0100
+++ new/libnbd-1.24.1/lib/utils.c       2026-02-17 12:50:23.000000000 +0100
@@ -414,10 +414,11 @@
 
 }
 
-int nbd_internal_socket (int domain,
-                         int type,
-                         int protocol,
-                         bool nonblock)
+int
+nbd_internal_socket (int domain,
+                     int type,
+                     int protocol,
+                     bool nonblock)
 {
   int fd;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libnbd-1.24.0/tests/Makefile.am 
new/libnbd-1.24.1/tests/Makefile.am
--- old/libnbd-1.24.0/tests/Makefile.am 2025-12-16 11:59:53.000000000 +0100
+++ new/libnbd-1.24.1/tests/Makefile.am 2026-02-17 12:50:23.000000000 +0100
@@ -227,7 +227,6 @@
        connect-tcp \
        connect-tcp6 \
        aio-connect \
-       aio-connect-port \
        aio-parallel \
        aio-parallel-load \
        synch-parallel \
@@ -312,9 +311,6 @@
        socket-activation-name \
        $(NULL)
 
-# This test is compiled but not run because it requires a fixed port:
-#      aio-connect-port
-
 errors_enum_SOURCES = errors-enum.c
 errors_enum_LDADD = $(top_builddir)/lib/libnbd.la
 
@@ -630,9 +626,6 @@
        $(NULL)
 aio_connect_LDADD = $(top_builddir)/lib/libnbd.la
 
-aio_connect_port_SOURCES = aio-connect-port.c
-aio_connect_port_LDADD = $(top_builddir)/lib/libnbd.la
-
 aio_parallel_SOURCES = aio-parallel.c
 aio_parallel_CPPFLAGS = \
        $(AM_CPPFLAGS) \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libnbd-1.24.0/tests/aio-connect-port.c 
new/libnbd-1.24.1/tests/aio-connect-port.c
--- old/libnbd-1.24.0/tests/aio-connect-port.c  2025-12-16 11:59:53.000000000 
+0100
+++ new/libnbd-1.24.1/tests/aio-connect-port.c  1970-01-01 01:00:00.000000000 
+0100
@@ -1,128 +0,0 @@
-/* NBD client library in userspace
- * Copyright Red Hat
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/* Test connecting to a fixed IPv4 TCP port (2000) using
- * nbd_aio_connect.  This test is compiled but not normally run
- * because of the requirement for the fixed port number.
- *
- * See also:
- * https://listman.redhat.com/archives/libguestfs/2021-June/msg00205.html
- */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <libnbd.h>
-
-#define PIDFILE "aio-connect-port.pid"
-
-int
-main (int argc, char *argv[])
-{
-  struct nbd_handle *nbd;
-  int port = 2000;
-  const char *port_str = "2000";
-  pid_t pid;
-  size_t i;
-  struct sockaddr_in addr;
-  char *actual_uri, *expected_uri;
-
-  unlink (PIDFILE);
-
-  pid = fork ();
-  if (pid == -1) {
-    perror ("fork");
-    exit (EXIT_FAILURE);
-  }
-  if (pid == 0) {
-    execlp (NBDKIT,
-            "nbdkit", "-f", "-p", port_str, "-P", PIDFILE,
-            "--exit-with-parent", "null", NULL);
-    perror ("nbdkit");
-    _exit (EXIT_FAILURE);
-  }
-
-  /* Wait for nbdkit to start listening. */
-  for (i = 0; i < 60; ++i) {
-    if (access (PIDFILE, F_OK) == 0)
-      break;
-    sleep (1);
-  }
-  unlink (PIDFILE);
-
-  nbd = nbd_create ();
-  if (nbd == NULL) {
-    fprintf (stderr, "%s\n", nbd_get_error ());
-    exit (EXIT_FAILURE);
-  }
-  if (nbd_supports_uri (nbd) != 1) {
-    fprintf (stderr, "skip: compiled without URI support\n");
-    exit (77);
-  }
-
-  addr.sin_family = AF_INET;
-  addr.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
-  addr.sin_port = htons (port);
-
-  if (nbd_aio_connect (nbd, (struct sockaddr *)&addr, sizeof addr) == -1) {
-    fprintf (stderr, "%s\n", nbd_get_error ());
-    exit (EXIT_FAILURE);
-  }
-
-  /* Wait until we have connected. */
-  while (!nbd_aio_is_ready (nbd)) {
-    if (nbd_poll (nbd, -1) == -1) {
-      fprintf (stderr, "%s\n", nbd_get_error ());
-      exit (EXIT_FAILURE);
-    }
-  }
-
-  /* libnbd should be able to construct a URI for this connection. */
-  if (asprintf (&expected_uri, "nbd://127.0.0.1:%s/", port_str) == -1) {
-    perror ("asprintf");
-    exit (EXIT_FAILURE);
-  }
-  actual_uri = nbd_get_uri (nbd);
-  if (actual_uri == NULL) {
-    fprintf (stderr, "%s\n", nbd_get_error ());
-    exit (EXIT_FAILURE);
-  }
-  if (strcmp (actual_uri, expected_uri) != 0) {
-    fprintf (stderr, "%s: actual URI %s != expected URI %s\n",
-             argv[0], actual_uri, expected_uri);
-    exit (EXIT_FAILURE);
-  }
-  free (actual_uri);
-  free (expected_uri);
-
-  if (nbd_shutdown (nbd, 0) == -1) {
-    fprintf (stderr, "%s\n", nbd_get_error ());
-    exit (EXIT_FAILURE);
-  }
-
-  nbd_close (nbd);
-  exit (EXIT_SUCCESS);
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libnbd-1.24.0/tests/socket-activation-name.c 
new/libnbd-1.24.1/tests/socket-activation-name.c
--- old/libnbd-1.24.0/tests/socket-activation-name.c    2025-12-16 
11:59:53.000000000 +0100
+++ new/libnbd-1.24.1/tests/socket-activation-name.c    2026-02-17 
12:50:23.000000000 +0100
@@ -34,6 +34,7 @@
 #include "requires.h"
 
 #define DEBUG_FILE "socket-activation-name.out"
+#define NAME "hellomagicname"
 
 int
 main (int argc, char *argv[])
@@ -41,15 +42,13 @@
   struct nbd_handle *nbd;
   char *r;
 
-  /* Test that this version of nbdkit supports -D nbdkit.environ=1
-   * added in nbdkit 1.35.2.
-   *
-   * As a side-effect, also checks we have nbdkit, the null plugin and
-   * a working grep command, all needed below.
+  /* This requires nbdkit >= 1.48 (actually 1.47.5) which prints the
+   * socket activation name in debugging output.
    */
-  requires ("libnbd_sentinel=42 "
-            NBDKIT " -v -D nbdkit.environ=1 null --run true 2>&1 | "
-            "grep -sq 'debug.*libnbd_sentinel=42'");
+  requires (NBDKIT " --version");
+  requires ("minor=$( " NBDKIT " --dump-config |\n"
+            "        grep ^version_minor | cut -d= -f2 )\n"
+            "test $minor -ge 48");
 
   nbd = nbd_create ();
   if (nbd == NULL) {
@@ -63,48 +62,25 @@
   assert (strcmp (r, "") == 0);
   free (r);
 
-  /* Run external nbdkit and check the LISTEN_FDNAMES environment
-   * variable is set to "unknown".  We need to capture the debug
-   * output of nbdkit, hence the journey through the shell.
+  /* Check we can set it to something and read that back. */
+  assert (nbd_set_socket_activation_name (nbd, NAME) == 0);
+  r = nbd_get_socket_activation_name (nbd);
+  assert (r != NULL);
+  assert (strcmp (r, NAME) == 0);
+  free (r);
+
+  /* Run external nbdkit.  Capture the debug output of nbdkit, hence
+   * the journey through the shell.
    */
   unlink (DEBUG_FILE);
   char *cmd[] = {
     "sh", "-c",
     "exec 2> " DEBUG_FILE "\n"
-    "exec " NBDKIT " --exit-with-parent -v -D nbdkit.environ=1 null 1024\n",
+    "exec " NBDKIT " --exit-with-parent -v null 1024\n",
     NULL
   };
-  if (nbd_connect_systemd_socket_activation (nbd, cmd) == -1) {
-    fprintf (stderr, "%s\n", nbd_get_error ());
-    exit (EXIT_FAILURE);
-  }
-
-  /* Check the size is expected so we know we managed to connect to nbdkit. */
-  assert (nbd_get_size (nbd) == 1024);
-
-  nbd_close (nbd);
-
-  /* nbdkit doesn't know anything about socket activation names, but
-   * the LISTEN_FDNAMES environment variable should appear in the
-   * debug output.
-   */
-  assert (system ("grep 'debug.*LISTEN_FDNAMES=unknown' " DEBUG_FILE) == 0);
-  unlink (DEBUG_FILE);
-
-  /* Test again with a specific name. */
-  nbd = nbd_create ();
-  if (nbd == NULL) {
-    fprintf (stderr, "%s\n", nbd_get_error ());
-    exit (EXIT_FAILURE);
-  }
-  /* Check we can set it to something and read that back. */
-  assert (nbd_set_socket_activation_name (nbd, "hello") == 0);
-  r = nbd_get_socket_activation_name (nbd);
-  assert (r != NULL);
-  assert (strcmp (r, "hello") == 0);
-  free (r);
 
-  /* Run external nbdkit again (same command as above). */
+  /* Run external nbdkit. */
   if (nbd_connect_systemd_socket_activation (nbd, cmd) == -1) {
     fprintf (stderr, "%s\n", nbd_get_error ());
     exit (EXIT_FAILURE);
@@ -114,8 +90,8 @@
 
   nbd_close (nbd);
 
-  /* Check LISTEN_FDNAMES was set to the known value. */
-  assert (system ("grep 'debug.*LISTEN_FDNAMES=hello' " DEBUG_FILE) == 0);
+  /* Check the name appears in the output. */
+  assert (system ("grep 'debug.*" NAME "' " DEBUG_FILE) == 0);
   unlink (DEBUG_FILE);
 
   exit (EXIT_SUCCESS);

Reply via email to