Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
"rescan-scsi-bus.sh" no longer removes `/dev/null`
When running the "rescan-scsi-bus.sh" script, due to incorrect syntax in redirecting output to the `/dev/null` device file while executing the `/bin/rm` utility, the redirection did not happen but `/dev/null` was instead interpreted as a file to be removed. As a consequence, running "rescan-scsi-bus.sh" with the "--update" option removed `/dev/null` during execution. This bug has been fixed, and /dev/null is no longer removed by "rescan-scsi-bus.sh".
Description of problem:
When running the command 'rescan-scsi-bus.sh -u' the /dev/null file will be deleted.
Version-Release number of selected component (if applicable):
sg3_utils-1.28-6.el6.x86_64
sg3_utils-libs-1.28-6.el6.x86_64
2.6.32-504.16.2.el6.x86_64
Issue also present in RHEL7 at levels:
sg3_utils-libs-1.37-5.el7.x86_64
sg3_utils-1.37-5.el7.x86_64
3.10.0-229.el7.x86_64
How reproducible:
[root@rhel6a ~]# cat test.sh
#/bin/bash
rm tmp.out 2&>1 /dev/null
[root@rhel6a ~]# touch tmp.out
[root@rhel6a ~]# ls /dev | grep null
null
[root@rhel6a ~]# ./test.sh
[root@rhel6a ~]#
[root@rhel6a ~]# ls | grep tmp.out
[root@rhel6a ~]#
[root@rhel6a ~]# ls /dev | grep null
[root@rhel6a ~]#
[root@rhel6a ~]# udevadm trigger
[root@rhel6a ~]#
[root@rhel6a ~]# ls /dev | grep null
null
Actual results:
The following on line 725 removes /dev/null because of the 2&>1
rm $tmpfile 2&>1 /dev/null
The set -x output shows:
+ rm /tmp/rescan-scsi-bus-s 2 /dev/null
* Issue does not reproduce if I change 2&>1 to either of the following:
2>
&>
* It does reproduce if I use 2>&1.
Expected results:
/dev/null not be deleted.
If I can be of any help please let me know.
John
Created attachment 1107282[details]
Fix /dev/null redirect mistakes
Updated the proposed patches with the new attachment (0001-Fix-dev-null-redirect-mistakes.patch), plus submitted it upstream.
Scratch build available here: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=10254401
Will wait for a final build when more issues from other bzs have considered.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://rhn.redhat.com/errata/RHBA-2016-0905.html