[Libguestfs] [PATCH nbdkit v2 3/3] tests: Add a simple test of nbdkit_export_name.

Eric Blake eblake at redhat.com
Sun Sep 15 02:53:26 UTC 2019


On 9/12/19 4:41 PM, Eric Blake wrote:

> Hmm - instead of making the handle be the name of a temporary file that
> contains the export name, you could just make the handle _be_ the export
> name:
> 
> open)
>   printf %s "$3"
>   ;;

Fails if $3 ends in newline, since nbdkit-sh-plugin strips (at most) one
trailing newline.

Instead, you committed 'echo "$3"', which fails if $3 is '-n', '-e',
'-E', or contains '\\'.


> and this would be something like:
> 
> pread)
>   echo "$2" | dd skip=$4 count=$3 iflag=skip_bytes,count_bytes

Same problem here.  I've pushed a fix that enhances the test, matching
with your commit documenting that parsing user-provided input is tricky.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20190914/27f83098/attachment.sig>


More information about the Libguestfs mailing list