From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 Description of problem: When nash needs to execute an external command a new process is forked. If the execve call fails this child will execute the rest of the script. This cause the rest of the script to be executed twice. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Run this script: #!/sbin/nash --force /foo/bar echo hello Actual Results: (forcing normal run) Red Hat nash version 3.5.22 starting ERROR: failed in exec of /foo/bar hello hello Expected Results: (forcing normal run) Red Hat nash version 3.5.22 starting ERROR: failed in exec of /foo/bar hello Additional info:
Created attachment 109361 [details] One-liner that appears to solve the problem.
Fedora Core 2 is now maintained by the Fedora Legacy project for security updates only. If this problem is a security issue, please reopen and reassign to the Fedora Legacy product. If it is not a security issue and hasn't been resolved in the current FC3 updates or in the FC4 test release, reopen and change the version to match.
This problem also exist in FC3 with mkinitrd-4.1.18-2, FC3 with mkinitrd-4.2.7-1, and FC4 with mkinitrd-4.2.15-1.
Reassigning to FC4 as per comment #3. Kasper, can you also test with FC5 and FC6test, if you have a few moments? Sorry I didn't notice your message last year.
With mkinitrd-5.0.32-1 the problem cannot be reproduced by specifying a nonexisting executable. It looks like these two lines are intended to catch a bad executable being specified. But for some reason I don't see the error message: if (access(bin, X_OK)) { eprintf("failed to execute %s: %m\n", bin); return 1; } However the actual code around the execve call still contains the original bug, so in the event that access say it is OK, but execve fails, the bug can still be triggered. I think my earlier patch to fix the problem still applies. The problem can be reproduced with a file marked executable, but not in a proper executable format. Create /tmp/foobar with this command and execute the following script: chmod 755 /tmp/foobar >/tmp/foobar #!/sbin/nash --force /tmp/foobar echo hello I get the following output: (forcing normal run) Red Hat nash version 5.0.32 starting ERROR: failed in exec of /tmp/foobar: Exec format error hello hello
Fedora Core 5 is no longer maintained. Is this bug still present in Fedora 8?
The bug can be reproduced in Fedora 8 with the exact same steps as in 5.
This message is a reminder that Fedora 8 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 8. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '8'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 8's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 8 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Fedora 8 changed to end-of-life (EOL) status on 2009-01-07. Fedora 8 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. Thank you for reporting this bug and we are sorry it could not be fixed.