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

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



On Thursday 31 July 2008, Otavio Salvador wrote:
> > I don't really like the idea of hook scripts determining how the main
> > script works.
>
> Could you clarify why?

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.

Remember that anybody (think preseeding) can drop in 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!



Reply to: