Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 185100 - sys-apps/ifplugd-0.28-r8 init script has a logic error in config handling (OR should be AND for IGNORE_FAIL_POSITIVE, for -F option)
Summary: sys-apps/ifplugd-0.28-r8 init script has a logic error in config handling (OR...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Roy Marples (RETIRED)
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2007-07-12 18:48 UTC by Colin Bennett
Modified: 2007-07-12 21:08 UTC (History)
0 users

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


Attachments
Patch to fix the /etc/init.d/ifplugd script, changing the OR to AND (ifplugd-script-ignorefail.patch,573 bytes, patch)
2007-07-12 18:49 UTC, Colin Bennett
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Colin Bennett 2007-07-12 18:48:31 UTC
The ifplugd init script in /etc/init.d/ifplugd uses backwards (wrong!) logic in determining whether IGNORE_FAIL_POSITIVE==yes should result in passing the -F option to ifplugd.

The -F option results in ignoring failures (and treating them as success). However, the current script essentially says (pseudocode):
  IGNORE_FAIL_POSITIVE || args += "-F"
which can also be stated as:
  if (!IGNORE_FAIL_POSITIVE) args += "-F"

It should say  
  IGNORE_FAIL_POSITIVE && args += "-F"
which can also be stated as:
  if (IGNORE_FAIL_POSITIVE) args += "-F"

All that needs to be done is to change the "||" to an "&&" on the line that tests IGNORE_FAIL_POSITIVE in /etc/init.d/ifplugd.

Reproducible: Always

Steps to Reproduce:
1. Set IGNORE_FAIL_POSITIVE="no" in /etc/conf.d/ifplugd
2. Start ifplug: run /etc/init.d/ifplugd start
3. Examine the options that ifplugd has been started with:
     ps axuw | grep ifplugd

Actual Results:  
The output of 'ps' shows the '-F' option being passed to ifplugd, which should not be the case.


Expected Results:  
The ifplugd program should NOT be executed with the '-F' command line option.
Comment 1 Colin Bennett 2007-07-12 18:49:22 UTC
Created attachment 124672 [details, diff]
Patch to fix the /etc/init.d/ifplugd script, changing the OR to AND
Comment 2 Roy Marples (RETIRED) gentoo-dev 2007-07-12 21:08:49 UTC
ifplugd doesn't ship with an init script anymore as baselayout now controls it directly.