Bug#901185: [Debconf-devel] Bug#901185: me too

2018-12-09 Thread Luca Boccassi
On Tue, 12 Jun 2018 06:22:09 +0100 Colin Watson 
wrote:
> On Mon, Jun 11, 2018 at 08:52:11PM +0200, Andreas Metzler wrote:
> > On 2018-06-11 Colin Watson  wrote:
> > > On Sun, Jun 10, 2018 at 04:04:13PM +0200, Andreas Metzler wrote:
> > > > yes, resetting IFS to its default value in confmodule helps.
> > 
> > > Thanks.  For completeness, could you try this variant patch?  If
shells
> > > are going to be unreliable about setting IFS in this way, then
I'd
> > > rather just separate out the assignments altogether.
> > [snip]
> > 
> > Yes, this variant of the patch also works.
> > 
> > Thanks to your handholding we now have a minimal reproducer for the
> > issue:
> 
> Thanks.  Now that you have a reproducer that doesn't involve debconf
and
> so I won't be interfering with debugging, I've uploaded debconf
1.5.67
> with that confmodule patch.  I know it's a bash5 bug and will
hopefully
> be fixed, but we might as well be conservative in debconf when it's
easy
> to do so.
> 
> -- 
> Colin Watson   [cjwatson@debian.o
rg]

Hi,

FYI, this was fixed in bash 5.0 beta1:

$ ./bash --version
GNU bash, version 5.0.0(1)-beta (x86_64-pc-linux-gnu)
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ ./bash -o posix -c 'v=ok; v=bug read x 

signature.asc
Description: This is a digitally signed message part


Bug#901185: [Debconf-devel] Bug#901185: me too

2018-06-11 Thread Colin Watson
On Mon, Jun 11, 2018 at 08:52:11PM +0200, Andreas Metzler wrote:
> On 2018-06-11 Colin Watson  wrote:
> > On Sun, Jun 10, 2018 at 04:04:13PM +0200, Andreas Metzler wrote:
> > > yes, resetting IFS to its default value in confmodule helps.
> 
> > Thanks.  For completeness, could you try this variant patch?  If shells
> > are going to be unreliable about setting IFS in this way, then I'd
> > rather just separate out the assignments altogether.
> [snip]
> 
> Yes, this variant of the patch also works.
> 
> Thanks to your handholding we now have a minimal reproducer for the
> issue:

Thanks.  Now that you have a reproducer that doesn't involve debconf and
so I won't be interfering with debugging, I've uploaded debconf 1.5.67
with that confmodule patch.  I know it's a bash5 bug and will hopefully
be fixed, but we might as well be conservative in debconf when it's easy
to do so.

-- 
Colin Watson   [cjwat...@debian.org]



Bug#901185: [Debconf-devel] Bug#901185: me too

2018-06-10 Thread Colin Watson
On Sun, Jun 10, 2018 at 04:04:13PM +0200, Andreas Metzler wrote:
> On 2018-06-10 Colin Watson  wrote:
> > On Sun, Jun 10, 2018 at 03:03:28PM +0200, Andreas Metzler wrote:
> >> I have tried debugging the issue to get a minimal testcase. I have had
> >> some success. The issue is triggered by debconf.
> >> /usr/share/debconf/confmodule changes IFS to \n and with bash5 this
> >> change is persistent and breaks the maintainerscript.
> 
> > Does this patch help?
> 
> yes, resetting IFS to its default value in confmodule helps.

Thanks.  For completeness, could you try this variant patch?  If shells
are going to be unreliable about setting IFS in this way, then I'd
rather just separate out the assignments altogether.

diff --git a/confmodule b/confmodule
index 8347c0b0..3ef7a309 100644
--- a/confmodule
+++ b/confmodule
@@ -42,10 +42,11 @@ _db_cmd () {
_db_internal_IFS="$IFS"
IFS=' '
printf '%s\n' "$*" >&3
-   IFS="$_db_internal_IFS"
# Set to newline to get whole line.
IFS='
-' read -r _db_internal_line
+'
+   read -r _db_internal_line
+   IFS="$_db_internal_IFS"
# Disgusting, but it's the only good way to split the line,
# preserving all other whitespace.
RET="${_db_internal_line#[! ][  ]}"

(This does still seem like a bash bug though, unless there's some arcane
interpretation of the standards that I'm unaware of.)

Cheers,

-- 
Colin Watson   [cjwat...@debian.org]



Bug#901185: [Debconf-devel] Bug#901185: me too

2018-06-10 Thread Andreas Metzler
On 2018-06-10 Colin Watson  wrote:
> On Sun, Jun 10, 2018 at 03:03:28PM +0200, Andreas Metzler wrote:
>> I have tried debugging the issue to get a minimal testcase. I have had
>> some success. The issue is triggered by debconf.
>> /usr/share/debconf/confmodule changes IFS to \n and with bash5 this
>> change is persistent and breaks the maintainerscript.

> Does this patch help?

> diff --git a/confmodule b/confmodule
> index 8347c0b0..e6157520 100644
> --- a/confmodule
> +++ b/confmodule
> @@ -46,6 +46,7 @@ _db_cmd () {
>   # Set to newline to get whole line.
>   IFS='
>  ' read -r _db_internal_line
> + IFS="$_db_internal_IFS"
>   # Disgusting, but it's the only good way to split the line,
>   # preserving all other whitespace.
>   RET="${_db_internal_line#[! ][  ]}"

> (If so, that would suggest that the problem might be specifically in
> variable assignments preceding builtins.)

Hello Colin,

yes, resetting IFS to its default value in confmodule helps.

cu Andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'



Bug#901185: [Debconf-devel] Bug#901185: me too

2018-06-10 Thread Colin Watson
On Sun, Jun 10, 2018 at 03:03:28PM +0200, Andreas Metzler wrote:
> I have tried debugging the issue to get a minimal testcase. I have had
> some success. The issue is triggered by debconf.
> /usr/share/debconf/confmodule changes IFS to \n and with bash5 this
> change is persistent and breaks the maintainerscript.

Does this patch help?

diff --git a/confmodule b/confmodule
index 8347c0b0..e6157520 100644
--- a/confmodule
+++ b/confmodule
@@ -46,6 +46,7 @@ _db_cmd () {
# Set to newline to get whole line.
IFS='
 ' read -r _db_internal_line
+   IFS="$_db_internal_IFS"
# Disgusting, but it's the only good way to split the line,
# preserving all other whitespace.
RET="${_db_internal_line#[! ][  ]}"

(If so, that would suggest that the problem might be specifically in
variable assignments preceding builtins.)

-- 
Colin Watson   [cjwat...@debian.org]