[Libguestfs] [PATCH libnbd 7/9] generator: On entry to API functions, check Flags and OFlags parameters.

Richard W.M. Jones rjones at redhat.com
Sun Aug 11 08:30:10 UTC 2019


On Sun, Aug 11, 2019 at 09:26:14AM +0100, Richard W.M. Jones wrote:
> On Sat, Aug 10, 2019 at 04:38:20PM -0500, Eric Blake wrote:
> > Some of the checks in lib/rw.c are now unreachable with this in place.
> > Is it worth simplifying that?  (But not all of them - there are still
> > checks that depend on runtime values, such as nbd_pread accepting _DF
> > only if the server advertises it after the client requests structured
> > replies).  Also, this lets us pass all four existing command flags to
> > all commands that accept an OFlags parameter, even though none of the
> > commands accept all flags at once - the real protection being added here
> > is the check for completely unrecognized flags.
> 
> Right - this doesn't replace fine-grained checks in the functions
> themselves.  I'll have a look at lib/rw.c and see what checks might be
> removed.

Hmm - I think all the flag tests in lib/rw.c are still necessary ..?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW




More information about the Libguestfs mailing list