Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 447790 - sys-apps/openrc-0.11.8 has an logic error in bonding.sh
Summary: sys-apps/openrc-0.11.8 has an logic error in bonding.sh
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
: 468964 474902 (view as bug list)
Depends on:
Blocks: 439098
  Show dependency tree
 
Reported: 2012-12-19 05:41 UTC by Evgeny
Modified: 2013-08-28 16:47 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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. ***