Bug 86514

Summary: failed redirect gives ENOENT, not EPERM
Product: [Retired] Red Hat Public Beta Reporter: Kjetil T. Homme <kjetilho>
Component: bashAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: phoebe   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-03-25 18:04:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
strace of bash run exhibiting problem
none
ltrace of bash run exhibiting problem none

Description Kjetil T. Homme 2003-03-25 00:29:43 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030206

Description of problem:
the code has been changed to do
open("/etc/nosuchfile", O_WRONLY|O_TRUNC|O_LARGEFILE)
after a failed
open("/etc/nosuchfile", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666)

this results in errno being EPERM, which is highly confusing, at least to me :-)


Version-Release number of selected component (if applicable):
bash-2.05b-20

How reproducible:
Always

Steps to Reproduce:
as a normal user
echo hiya > /etc/nosuchfile


Actual Results:  bash: /etc/nosuchfile: No such file or directory


Expected Results:  bash: /etc/nosuchfile: Permission denied


Additional info:

Comment 1 Tim Waugh 2003-03-25 09:40:40 UTC
I don't see this.  Sure there's no file of that name?

Comment 2 Kjetil T. Homme 2003-03-25 14:57:45 UTC
of course I'm sure, and that is actually what bash tells me :-)

(btw, it's annoying that you close the bug as the very first response.  use MORE
INFO NEEDED or something.)

Comment 3 Tim Waugh 2003-03-25 15:31:02 UTC
Well, I need more information than I have. :-)

Show me the strace output.

Comment 4 Kjetil T. Homme 2003-03-25 16:18:55 UTC
Created attachment 90711 [details]
strace of bash run exhibiting problem

Comment 5 Kjetil T. Homme 2003-03-25 16:19:26 UTC
Created attachment 90712 [details]
ltrace of bash run exhibiting problem

Comment 6 Tim Waugh 2003-03-25 16:27:04 UTC
Oops, I misread the original comment, sorry!  I see the issue now.

Comment 7 Tim Waugh 2003-03-25 18:04:52 UTC
Fixed package is bash-2.05b-23.