bugGNU nano - Bugs: bug #25297, unable to read file due to usage...

 
 

bug #25297: unable to read file due to usage of chdir()

Submitted by:  Mike Frysinger <vapier>
Submitted on:  Sun 11 Jan 2009 07:46:17 AM UTC  
 
Severity: 3 - NormalStatus: Fixed
Assigned to: Chris Allegretta <astyanax>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 14 Feb 2009 03:48:34 AM UTC, comment #4:

Fixed in 2.1.8, and fallout from this fixed should be in 2.1.9.

Chris Allegretta <astyanax>
Project AdministratorIn charge of this item.
Mon 26 Jan 2009 04:13:34 PM UTC, comment #3:

yes, that seems to work, thanks

btw, current svn fails to link when justify has been disabled ...

Mike Frysinger <vapier>
Project Member
Mon 26 Jan 2009 08:49:13 AM UTC, comment #2:

Okay this is hopefully fixed in r4353, let me know if it works for the situation you're trying.

Chris Allegretta <astyanax>
Project AdministratorIn charge of this item.
Mon 26 Jan 2009 08:33:55 AM UTC, comment #1:

Hey Mike,

I am having a look at this; you're right that the chdir out of the directory which the user arguably shouldnt be able to get to is the problem, but since it's not completely unheard of for arrangements like this (e.g. sudo), nano should "just work" like a pager or vi does in this instance.

Chris Allegretta <astyanax>
Project AdministratorIn charge of this item.
Sun 11 Jan 2009 07:46:17 AM UTC, original submission:

if i'm sitting in a directory which is readable with a component that is not, nano is unable to read files. this is because it does a chdir() to the nano datadir (/usr/share/nano/ normally) and then tries to chdir() back to the old place.

$ head -n2 Makefile
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# Makefile. Generated from Makefile.in by configure.
$ strace nano Makefile
...
chdir("/usr/share/nano/") = 0
...
chdir("/var/tmp/portage/app-emulation/hercules-3.06/work/hercules-3.06/") = -1 EACCES (Permission denied)
...

and now shows an "Empty File". if the chdir() failed, nano should have aborted with an appropriate error message instead of trying to open up a file in /usr/share/nano/. ideally, it shouldnt have done a chdir() anywhere and so nano would have been able to read the file.

Mike Frysinger <vapier>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by astyanax (Posted a comment)
  • -unavailable- added by vapier (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 14 Feb 2009 03:48:34 AM UTCastyanaxStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Mon 26 Jan 2009 08:49:13 AM UTCastyanaxStatusIn Progress=>Ready For Test
    Mon 26 Jan 2009 08:33:55 AM UTCastyanaxStatusNone=>In Progress
      Privacy0(Error - Not Found)=>Public
      Assigned toNone=>astyanax

    Back to the top


    Powered by Savane 3.1-cleanup1