diff mbox series

[U/F/E/D/B/X] UBUNTU: [Packaging]: config-check: some enforcement is ignored

Message ID 20191219182951.61115-1-cascardo@canonical.com
State New
Headers show
Series [U/F/E/D/B/X] UBUNTU: [Packaging]: config-check: some enforcement is ignored | expand

Commit Message

Thadeu Lima de Souza Cascardo Dec. 19, 2019, 6:29 p.m. UTC
Whenever config-check finds an entry like:

CONFIG_VFIO mark<ENFORCED>note<LP#1636733>

it will consider mark<ENFORCED>note as the option name, as the regexp allows
any characters not in the whitespace class (\S). By using a class like [^\s<],
that is, not whitespace and not '<', it will be correctly parsed.

We could fix the entries that have this problem, but fixing the parser is more
robust.

Ignore: yes

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 debian/scripts/config-check | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marcelo Henrique Cerri Jan. 7, 2020, 2:01 p.m. UTC | #1
Acked-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Kleber Sacilotto de Souza Jan. 7, 2020, 5:01 p.m. UTC | #2
On 2019-12-19 19:29, Thadeu Lima de Souza Cascardo wrote:
> Whenever config-check finds an entry like:
> 
> CONFIG_VFIO mark<ENFORCED>note<LP#1636733>
> 
> it will consider mark<ENFORCED>note as the option name, as the regexp allows
> any characters not in the whitespace class (\S). By using a class like [^\s<],
> that is, not whitespace and not '<', it will be correctly parsed.
> 
> We could fix the entries that have this problem, but fixing the parser is more
> robust.
> 
> Ignore: yes
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

> ---
>  debian/scripts/config-check | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/debian/scripts/config-check b/debian/scripts/config-check
> index 843f5999006b..95edd39dc407 100755
> --- a/debian/scripts/config-check
> +++ b/debian/scripts/config-check
> @@ -113,7 +113,7 @@ for $config (keys %annot) {
>  	$options = $annot{$config};
>  
>  	$policy = undef;
> -	while ($options =~ /\s*(\S+)<(.*?)?>/g) {
> +	while ($options =~ /\s*([^\s<]+)<(.*?)?>/g) {
>  		($option, $value) = ($1, $2);
>  
>  		if ($option eq 'mark' && $value eq 'ENFORCED') {
>
Kleber Sacilotto de Souza Jan. 7, 2020, 5:04 p.m. UTC | #3
On 2019-12-19 19:29, Thadeu Lima de Souza Cascardo wrote:
> Whenever config-check finds an entry like:
> 
> CONFIG_VFIO mark<ENFORCED>note<LP#1636733>
> 
> it will consider mark<ENFORCED>note as the option name, as the regexp allows
> any characters not in the whitespace class (\S). By using a class like [^\s<],
> that is, not whitespace and not '<', it will be correctly parsed.
> 
> We could fix the entries that have this problem, but fixing the parser is more
> robust.
> 
> Ignore: yes
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
> ---
>  debian/scripts/config-check | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/debian/scripts/config-check b/debian/scripts/config-check
> index 843f5999006b..95edd39dc407 100755
> --- a/debian/scripts/config-check
> +++ b/debian/scripts/config-check
> @@ -113,7 +113,7 @@ for $config (keys %annot) {
>  	$options = $annot{$config};
>  
>  	$policy = undef;
> -	while ($options =~ /\s*(\S+)<(.*?)?>/g) {
> +	while ($options =~ /\s*([^\s<]+)<(.*?)?>/g) {
>  		($option, $value) = ($1, $2);
>  
>  		if ($option eq 'mark' && $value eq 'ENFORCED') {
> 

Applied to xenial/linux, bionic/linux, disco/linux and eoan/linux.

Thanks,
Kleber
Seth Forshee Jan. 8, 2020, 3:35 a.m. UTC | #4
On Thu, Dec 19, 2019 at 03:29:51PM -0300, Thadeu Lima de Souza Cascardo wrote:
> Whenever config-check finds an entry like:
> 
> CONFIG_VFIO mark<ENFORCED>note<LP#1636733>
> 
> it will consider mark<ENFORCED>note as the option name, as the regexp allows
> any characters not in the whitespace class (\S). By using a class like [^\s<],
> that is, not whitespace and not '<', it will be correctly parsed.
> 
> We could fix the entries that have this problem, but fixing the parser is more
> robust.
> 
> Ignore: yes
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>

Applied to focal/master-next and unstable/master, thanks!
diff mbox series

Patch

diff --git a/debian/scripts/config-check b/debian/scripts/config-check
index 843f5999006b..95edd39dc407 100755
--- a/debian/scripts/config-check
+++ b/debian/scripts/config-check
@@ -113,7 +113,7 @@  for $config (keys %annot) {
 	$options = $annot{$config};
 
 	$policy = undef;
-	while ($options =~ /\s*(\S+)<(.*?)?>/g) {
+	while ($options =~ /\s*([^\s<]+)<(.*?)?>/g) {
 		($option, $value) = ($1, $2);
 
 		if ($option eq 'mark' && $value eq 'ENFORCED') {