[pkg-dhcp-devel] Bug#849100: Bug fix incomplete

Ori Berger debian-bug-reports at orib.net
Mon Jan 9 09:31:30 UTC 2017

Thank you for addressing my bug report #849100.

I believe, however, that the fix only partially addresses the bug.

In current master, 
(both in the same function "exit_with_hooks", there is a check of 
success in the form

     if ! run_something ; then
         exit_status = $?

Which is erronous - it is guaranteed to set exit_status=0 which is not 
the intended result.

The reason this happens is that the "if/then" construct already eats the 
$? return code. To get convince myself, I used the following test:

return_1() {
     return 1

echo "RC is $?"

if ! return_1; then
   echo "then RC is $?"
   echo "else RC is $?"
RC is 1
then RC is 0

The solution requires either:

     if ! run_something ; then
         exit_status = $?

to be replaced with something like


or some other construct that stores the $? return code before "if/then" 
eats it. I am not a shell expert, I'm not sure the fix above is exactly 
what is needed, but as my example test script shows, there is still a bug.

More information about the pkg-dhcp-devel mailing list