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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250206081033.49a7f4d6@kernel.org>
Date: Thu, 6 Feb 2025 08:10:33 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Donald Hunter <donald.hunter@...il.com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>, Eric
 Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Simon
 Horman <horms@...nel.org>, Johannes Berg <johannes@...solutions.net>,
 linux-wireless@...r.kernel.org, donald.hunter@...hat.com
Subject: Re: [PATCH net-next v3 06/10] tools/net/ynl: sanitise enums with
 leading digits in ynl-gen-c

On Thu,  6 Feb 2025 09:26:54 +0000 Donald Hunter wrote:
>  class Type(SpecAttr):
> +    starts_with_digit = re.compile(r"^\d")
> +
>      def __init__(self, family, attr_set, attr, value):
>          super().__init__(family, attr_set, attr, value)
>  
> @@ -74,6 +76,8 @@ class Type(SpecAttr):
>          self.c_name = c_lower(self.name)
>          if self.c_name in _C_KW:
>              self.c_name += '_'
> +        if self.starts_with_digit.match(self.c_name):
> +            self.c_name = '_' + self.c_name

bit heavyweight with the regex? I think this would do:

	if self.c_name[0].isdigit():

but either way:

Acked-by: Jakub Kicinski <kuba@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ