[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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

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

Attachment: signature.asc
Description: OpenPGP digital signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]