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

Bug#492861: Progress bar rewinds when running pre-pkgsel.d/10popcon



On Tue, Aug 05, 2008 at 06:33:12PM +0200, Frans Pop wrote:
> Because not only is there absolutely no need for them to do so, it is also 
> seriously fragile to expect random hook scripts to output nothing else 
> than their progress bar end position.

The patch handles any script output and log it.  The progress bar end
position must be on the last line of the output to be considered,
though.

> Remember that anybody (think preseeding) can drop in hook scripts.

I actually decided to go that way thinking about custom hook scripts…

> With the proposed patch a hook script can blow up the whole postinst by 
> just "leaking" some output to STDOUT.
> 
> Example
> -------
> Hook script has:
>     if grep "GenuineIntel" /proc/cpuinfo; then
>          <do something>
>     fi
>     exit 0
> 
> Due to the minor bug of the forgotten '-q' progress_to will be equal to
>     vendor_id       : GenuineIntel
> 
> And with 'set -e'
>     if [ "$progress_to" -gt $progress_from ]; then
> will make the postinst go BOOOOM!

Actually, it won't as the test is run inside an "if" expression.
"/usr/bin/[" will simply return false and go on.  An unpretty error
message [1] will be displayed but that could be mitigated by redirecting
stderr to /dev/null.

[1] sh: vendor_id       : GenuineIntel: bad number

Anyway, I am open to any solutions that would actually fix #492861.
The one discussed here could be one of them.  But I don't see it as
anymore fragile than the current code.

Cheers,
-- 
Jérémy Bobbio                        .''`. 
lunar@debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   

Attachment: signature.asc
Description: Digital signature


Reply to: