RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 602941 - RHEL 6 beta 1: syntax error in /etc/sysconfig/network-scripts/ifup-ib
Summary: RHEL 6 beta 1: syntax error in /etc/sysconfig/network-scripts/ifup-ib
Keywords:
Status: CLOSED DUPLICATE of bug 612284
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: rdma
Version: 6.0
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Doug Ledford
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-11 05:11 UTC by Justin Clift
Modified: 2010-08-02 14:21 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 596823
Environment:
Last Closed: 2010-08-02 14:21:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Justin Clift 2010-06-11 05:11:02 UTC
+++ This bug was initially created as a clone of Bug #596823 +++

Created an attachment (id=417276)
Syntax error fix for /etc/sysconfig/network-scripts/ifup-ib from openib-1.4.1-5.el5

Description of problem:

There is a syntax error in /etc/sysconfig/network-scripts/ifup-ib which
causes the following boot process error message during Infiniband interface initialization:

ifup-ib: line 79: [: too many arguments

The problem is that bash's "-a" (AND) operator is not evaluated lazily i.e. the following construct in ifup-ib does not work correctly if the MTU variable is unset/empty:

        # cap the MTU where we should based upon mode
        if [ -n "${MTU}" -a $MTU -gt 2044 ]; then
            MTU=2044
        fi

This alternative works because the && operator is evaluated lazily:

        # cap the MTU where we should based upon mode
        if [ -n "${MTU}" ] && [ $MTU -gt 2044 ]; then
            MTU=2044
        fi

Another alternative would be this

        # cap the MTU where we should based upon mode
        if [ -n "${MTU}" ]; then
            if [ $MTU -gt 2044 ]; then
                MTU=2044
            fi
        fi

I've attached a patch which fixes the two occurrences of this construct in ifup-ib.

Version-Release number of selected component (if applicable):

# rpm -q openib
openib-1.4.1-5.el5

How reproducible:

Boot a system with an active IB interface which has not MTU
configured explicitly in /etc/sysconfig/network-scripts/ifcfg-ib0.

Steps to Reproduce:
1. Configure an ib0 interface without setting MTU in /etc/sysconfig/network-scripts/ifcfg-ib0
2. Boot the system
3. Watch for the error messages during ib0 interface initialization.
  
Actual results:

ifup-ib: line 79: [: too many arguments

Expected results:

No error message

Additional info:

Test cases:

$ cat MTU-old.sh
#!/bin/bash                                      

MTU=""
if [ -n "${MTU}" -a $MTU -gt 2044 ]; then
        echo 1a                          
else                                     
        echo 1b                          
fi                                       

MTU="2000"
if [ -n "${MTU}" -a $MTU -gt 2044 ]; then
        echo 2a                          
else                                     
        echo 2b                          
fi

MTU="3000"
if [ -n "${MTU}" -a $MTU -gt 2044 ]; then
        echo 3a
else
        echo 3b
fi

$ cat MTU-new.sh
#!/bin/bash

MTU=""
if [ -n "${MTU}" ] && [ $MTU -gt 2044 ]; then
        echo 1a
else
        echo 1b
fi

MTU="2000"
if [ -n "${MTU}" ] && [ $MTU -gt 2044 ]; then
        echo 2a
else
        echo 2b
fi

MTU="3000"
if [ -n "${MTU}" ] && [ $MTU -gt 2044 ]; then
        echo 3a
else
        echo 3b
fi

Test results:

$ ./MTU-old.sh
./MTU-old.sh: line 4: [: too many arguments
1b
2b
3a
$ ./MTU-new.sh
1b
2b
3a

Comment 2 Justin Clift 2010-06-11 05:13:32 UTC
This bug is present in RHEL 6 beta 1, in the "/etc/sysconfig/network-scripts/ifup-ib" script belonging to the rdma package.

The fix suggested in BZ #596823 fixes the bug in RHEL 6 beta 1 too.

As a data point, this bug is also in the rdma package in F14 rawhide.

Comment 3 RHEL Program Management 2010-06-11 05:23:20 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 4 RHEL Program Management 2010-07-15 14:51:58 UTC
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release. It has
been denied for the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **

Comment 5 Justin Clift 2010-07-15 14:57:00 UTC
Guys,

This is a trivial scripting fix that addresses an init script problem that should have been caught by QE.

Doug?

Comment 6 Karsten Weiss 2010-07-15 18:17:06 UTC
No offense, but this is absurd. I understand that you want to be on the safe side with the enterprise distribution but come on! IT's a simple two line fix in a bash script. Either include it or drop it. But don't delay the decision for months (like with so many other bugs).

(Do you have an idea how demotivating this is for a bug reporter?)

Comment 7 Karsten Weiss 2010-07-15 18:30:43 UTC
BTW: I've originally filed this on May 27th 2010 (#596823) several *weeks* before RHEL6 beta 2 was released. And even this bug clone for RHEL6 was filed more than two weeks before beta 2.

Not to mention that so far nothing happened for #596823 either.

Comment 8 Doug Ledford 2010-08-02 14:21:23 UTC

*** This bug has been marked as a duplicate of bug 612284 ***


Note You need to log in before you can comment on or make changes to this bug.