bugGNU nano - Bugs: bug #60278, an unwritable DOS file gets...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #60278: an unwritable DOS file gets silently changed to Unix format

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Tue 23 Mar 2021 04:08:21 PM UTC  
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  Benno Schulenberg <bens> Open/Closed:  Closed

Wed 24 Mar 2021 11:24:08 AM UTC, comment #2: 

Fixed in git, commit 09b919a6, by always assigning to 'openfile->fmt', also when the file is unwritable.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 23 Mar 2021 04:17:09 PM UTC, comment #1: 

Bug exists since version 2.6.0.  Probably since commit 0293eac1.  (I didn't bisect, but this commit prevents openfile->fmt from being set to DOS_FILE or MAC_FILE when the file is unwritable.)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 23 Mar 2021 04:08:21 PM UTC, original submission:  

To reproduce, run:

printf "word\r\n" >xxx
src/nano --ignore --nohelp xxx

Type ^O and see that the file would be stored in "DOS Format".

Type ^C ^X, run 'chmod a-w xxx' and open the same file again with the above src/nano command.

Type ^O again and see that now the file would be stored without any format, meaning: Unix format.  This is unexpected.  (Of course, the file is unwritable, but if the user chooses to save the file under a different name, then this new file will not be in DOS format, which is unexpected.  And a diff with the original file would find that all lines have changed, even when no edits were made -- this is unwanted.)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-04-30 bens Open/ClosedOpen => Closed
    2021-03-24 bens StatusNone => Fixed
    2021-03-23 bens Assigned toNone => bens

    Back to the top


    Powered by Savane 3.7