[PATCH for-5.2? 0/2] authz: Add missing NULL checks

Kevin Wolf posted 2 patches 3 years, 5 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201117163045.307451-1-kwolf@redhat.com
Maintainers: "Daniel P. Berrangé" <berrange@redhat.com>
authz/pamacct.c |  6 ++++++
authz/simple.c  | 14 ++++++++++++++
2 files changed, 20 insertions(+)
[PATCH for-5.2? 0/2] authz: Add missing NULL checks
Posted by Kevin Wolf 3 years, 5 months ago
While trying to write a QAPI schema for user creatable object types, I
have to figure out whether properties are mandatory or options.

Turns out that some authz object types have properties that should be
mandatory because the code assumes they are non-NULL, but we never check
that they are actually given.

Kevin Wolf (2):
  authz-pam: Check that 'service' property is set
  authz-simple: Check that 'identity' property is set

 authz/pamacct.c |  6 ++++++
 authz/simple.c  | 14 ++++++++++++++
 2 files changed, 20 insertions(+)

-- 
2.28.0


Re: [PATCH for-5.2? 0/2] authz: Add missing NULL checks
Posted by Daniel P. Berrangé 3 years, 5 months ago
On Tue, Nov 17, 2020 at 05:30:43PM +0100, Kevin Wolf wrote:
> While trying to write a QAPI schema for user creatable object types, I
> have to figure out whether properties are mandatory or options.
> 
> Turns out that some authz object types have properties that should be
> mandatory because the code assumes they are non-NULL, but we never check
> that they are actually given.

Hmm, avoiding manual code to check for mandatory options will be a
nice plus point of using QAPI


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|