Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 447790

Summary: sys-apps/openrc-0.11.8 has an logic error in bonding.sh
Product: Gentoo Hosted Projects Reporter: Evgeny <worklord>
Component: OpenRCAssignee: OpenRC Team <openrc>
Status: RESOLVED FIXED    
Severity: normal CC: beelzebubbie.logs, mschiff, worklord
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 439098    

Description Evgeny 2012-12-19 05:41:34 UTC
Look at the http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commitdiff;h=f671e0a28fe566566b5465afbda985542f77ed8a;hp=6d84a4aed8dd519641c8fd6994fb93135efb122d

and see lines:

-               [ "${n}" != "mode" ] || continue
+               [ "${n}" != "mode" -o "${n}" != "miimon" ] || continue

The second one must be looked as:

+               [ "${n}" != "mode" -a "${n}" != "miimon" ] || continue



Reproducible: Always




Let's try simple script:

#!/bin/bash

for n in a b c miimon mode; do
    [ "${n}" != "mode" -o "${n}" != "miimon" ] || continue
    echo "${n}"
done

We get 

a
b
c
miimon
mode

Must be

a
b
c

So with these

#!/bin/bash

for n in a b c miimon mode; do
    [ "${n}" != "mode" -a "${n}" != "miimon" ] || continue
    echo "${n}"
done

we are get what we need.
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-12-20 21:30:07 UTC
fixed in commit e0bbe8d, logic changed to be more readable as well.
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2013-08-28 16:18:28 UTC
*** Bug 474902 has been marked as a duplicate of this bug. ***
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2013-08-28 16:47:06 UTC
*** Bug 468964 has been marked as a duplicate of this bug. ***