[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#740564: apt-listbugs: auxiliary script send-hook-info.rb fails to work with Ruby 2.0



Hi,

* Francesco Poli <invernomuto@paranoici.org> [140305 22:52]:
> Hello Debian Ruby regulars,
> could some of you please take a look at bug #740564, hoping it is not
> too much bother?
> Does anyone have any idea of what's wrong?
[...]
> However, I failed to understand how I could fix the script: I tried with
> the following modification
> 
> --- apt-listbugs/examples/send-hook-info.rb     2014-02-23 16:31:54.000000000 +0100
> +++ TEST_send-hook-info.rb      2014-03-03 23:17:29.000000000 +0100
> @@ -52,7 +52,7 @@
>  if Process.fork().nil?
>    # the child
>    write_fd.close
> -  exec command
> +  exec(command, :close_others=>false)
>    read_fd.close
>    exit 0
>  else
> 
> but it does not seem to change anything in the tests described in bug
> #740564...

Having looked at ruby/process.c and ruby/io.c in 1.9.3 and 2.0, I'd
say the 2.0 behaviour is what always was intended, but it's very
poorly documented.

I believe (haven't verified) that you need to explicitly list the
FDs that you want to pass on to the child in the exec options (see
Process#spawn redirection); it appears :close_others changed meaning
a bit to "any non-standard FD that's not in the redirection list"
(from "any non-standard FD if enabled") and setting it to false no
longer does anything.

> P.S.: please keep the bug address in Cc:, thanks!

-- 
 ,''`.  Christian Hofstaedtler <zeha@debian.org>
: :' :  Debian Developer
`. `'   7D1A CFFA D9E0 806C 9C4C  D392 5C13 D6DB 9305 2E03
  `-

Attachment: signature.asc
Description: Digital signature


Reply to: