mbox series

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

Message ID 20201117163045.307451-1-kwolf@redhat.com (mailing list archive)
Headers show
Series authz: Add missing NULL checks | expand

Message

Kevin Wolf Nov. 17, 2020, 4:30 p.m. UTC
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(+)

Comments

Daniel P. Berrangé Nov. 17, 2020, 4:44 p.m. UTC | #1
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