lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <m2frx2h10n.fsf@gmail.com>
Date: Thu, 07 Mar 2024 08:58:00 +0000
From: Donald Hunter <donald.hunter@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org,  "David S. Miller" <davem@...emloft.net>,  Eric
 Dumazet <edumazet@...gle.com>,  Paolo Abeni <pabeni@...hat.com>,  Jacob
 Keller <jacob.e.keller@...el.com>,  Jiri Pirko <jiri@...nulli.us>,
  Stanislav Fomichev <sdf@...gle.com>,  donald.hunter@...hat.com
Subject: Re: [PATCH net-next v2 5/5] doc/netlink/specs: Add spec for nlctrl
 netlink family

Jakub Kicinski <kuba@...nel.org> writes:

> On Wed, 6 Mar 2024 22:54:08 +0000 Donald Hunter wrote:
>> > I've used
>> >         enum-name:
>> > i.e. empty value in other places.
>> > Is using empty string more idiomatic?  
>> 
>> I got this when I tried to use an empty value, so I used '' everywhere instead.
>> 
>> jsonschema.exceptions.ValidationError: None is not of type 'string'
>> 
>> Failed validating 'type' in
>> schema['properties']['attribute-sets']['items']['properties']['enum-name']:
>>     {'description': 'Name for the enum type of the attribute.',
>>      'type': 'string'}
>> 
>> On instance['attribute-sets'][1]['enum-name']:
>>     None
>> 
>> It turns out that the fix for that is a schema change:
>> 
>> --- a/Documentation/netlink/genetlink-legacy.yaml
>> +++ b/Documentation/netlink/genetlink-legacy.yaml
>> @@ -169,7 +169,7 @@ properties:
>>            type: string
>>          enum-name:
>>            description: Name for the enum type of the attribute.
>> -          type: string
>> +          type: [ string, "null" ]
>>          doc:
>>            description: Documentation of the space.
>>            type: string
>> 
>> I'll respin with a cleaned up nlctrl spec and fixes for the schemas.
>
> Hm, is this some new version of jsonschema perhaps?
> We use empty values all over the place:
>
> $ git grep 'enum-name:$' -- Documentation/netlink/specs/
> Documentation/netlink/specs/ethtool.yaml:    enum-name:
> Documentation/netlink/specs/fou.yaml:    enum-name:
> Documentation/netlink/specs/ovs_datapath.yaml:    enum-name:
> Documentation/netlink/specs/ovs_flow.yaml:    enum-name:
> Documentation/netlink/specs/ovs_flow.yaml:    enum-name:

Ah, sorry I should have said that enum-name in definitions already had
'type: [ string, "null" ]'. It was missing from enum-name in attribute
sets and operations. It turns out that all the existing usage was for
definitions.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ