Skip to content

Commit 43ba3d9

Browse files
committed
server: Add $tls shell variable for captive nbdkit
1 parent 2c98b82 commit 43ba3d9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

docs/nbdkit-captive.pod

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ guestfish and expanded differently. Since NBD URIs are now widely
6767
supported this magic is no longer necessary. In nbdkit E<ge> 1.24
6868
both variables expand to the same URI.
6969

70+
=item C<$tls>
71+
72+
Corresponds to the I<--tls> option passed to nbdkit. If I<--tls=off>
73+
this is not set. If I<--tls=on> this is set to C<"1">. If
74+
I<--tls=require> this is set to C<"2">.
75+
7076
=item C<$port>
7177

7278
If E<ne> "", the port number that nbdkit is listening on.

server/captive.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ run_command (void)
118118
shell_quote (export_name, fp);
119119
putc ('\n', fp);
120120

121-
/* Construct $port and $unixsocket. */
121+
/* Construct $tls, $port and $unixsocket. */
122+
if (tls > 0)
123+
fprintf (fp, "tls=%d\n", tls);
122124
fprintf (fp, "port=");
123125
if (port)
124126
shell_quote (port, fp);

0 commit comments

Comments
 (0)