Ticket #82 (closed defect: fixed)

Opened 16 years ago

Last modified 11 years ago

savannah: "save as" retains mode

Reported by: ossi Owned by: slyfox
Priority: major Milestone: 4.7.0-pre2
Component: mc-core Version:
Keywords: Cc: imdagger@…
Blocked By: Blocking:
Branch state: merged Votes for changeset: commited-master

Description (last modified by ossi) (diff)

Original: http://savannah.gnu.org/bugs/?23512

Submitted by:Oswald Buddenhagen <ossi>Submitted on:Sat 07 Jun 2008 07:54:08 AM UTC
Category:EditorSeverity:3 - Normal
Status:NonePrivacy:Public
Assigned to:NoneOpen/Closed:|Open
Release:current (CVS or snapshot)Operating System:GNU/Linux

Original submission:

mcedit always saves with the original mode of the file, even when 
"save as" is used. this leads to the bizarre situation that even 
after giving a read-only file a new name, it will be still 
read-only. in quick-save mode, this makes the file impossible to 
save after the initial save as.
  1. Merged as changeset:65771004c4948dd664674e8dee2ddce11786d777
  2. Merged as changeset:c769f7fcd3b9aee910a7d3027d677621635faeb2 (with merge changeset:985f076e5f459bed4c84b5fb7742bdecc621f52f)

Attachments

add_write.diff (360 bytes) - added by IMDagger 15 years ago.
mc-4.7.0-pre1.edit_save.patch (378 bytes) - added by dborca 15 years ago.

Change History

comment:1 Changed 15 years ago by styx

  • Milestone set to future releases

Changed 15 years ago by IMDagger

comment:2 Changed 15 years ago by IMDagger

  • Cc imdagger@… added
  • severity set to no branch

comment:3 Changed 15 years ago by slyfox

  • Status changed from new to accepted
  • Owner set to slyfox

comment:4 Changed 15 years ago by slyfox

  • Votes for changeset set to slyfox
  • severity changed from no branch to on review

Pushed as changese:65771004c4948dd664674e8dee2ddce11786d777 to branch:82_sanitize_ro_file_edition.

Please review.

comment:5 Changed 15 years ago by slyfox

  • Milestone changed from future releases to 4.7.0-pre2

comment:6 Changed 15 years ago by slyfox

comment:7 Changed 15 years ago by iNode

  • Votes for changeset changed from slyfox to slyfox iNode
  • severity changed from on review to approved

comment:8 Changed 15 years ago by slyfox

  • Status changed from accepted to testing
  • Keywords commited-master added
  • Resolution set to fixed
  • severity changed from approved to merged
  • Description modified (diff)

comment:9 Changed 15 years ago by angel_il

  • Status changed from testing to closed

comment:10 Changed 15 years ago by dborca

  • Status changed from closed to reopened
  • Resolution fixed deleted

This fix is wrong.

Suppose you have two files, foo and bar. Both files have 444 permissions. Now edit foo and "Save". It can't save and instead prompt you to "Save As". Enter bar. It will chmod bar to 644.

If we don't touch touch existing file permissions for "Save", I don't see why we should for "Save As".

Attached is a patch (against 4.7.0-pre1) which adds S_IWUSR only if different_filename and file does not exist yet. For consistency, it's S_IWUSR not S_IWRITE.

Changed 15 years ago by dborca

comment:11 Changed 15 years ago by angel_il

you right :)
thank you.

comment:12 Changed 15 years ago by angel_il

  • Keywords commited-master removed
  • Votes for changeset slyfox iNode deleted
  • severity changed from merged to on rework

comment:13 Changed 15 years ago by IMDagger

ok, dborca is right, i forgot that destination file can has 444 permissions too :)

comment:14 Changed 15 years ago by slyfox

  • severity changed from on rework to on review

Pushed for testing as changeset:c769f7fcd3b9aee910a7d3027d677621635faeb2

Please review.

comment:15 Changed 15 years ago by angel_il

  • Votes for changeset set to angel_il

comment:16 Changed 15 years ago by andrew_b

  • Votes for changeset changed from angel_il to angel_il andrew_b
  • severity changed from on review to approved

comment:17 Changed 15 years ago by slyfox

  • Status changed from reopened to closed
  • Keywords commited-master added
  • Resolution set to fixed
  • Description modified (diff)
  • severity changed from approved to merged

comment:18 Changed 11 years ago by ossi

  • Description modified (diff)
  • Branch state set to no branch
  • Reporter changed from slavazanko to ossi

comment:19 Changed 11 years ago by andrew_b

  • Keywords commited-master removed
  • Votes for changeset changed from angel_il andrew_b to commited-master
  • Branch state changed from no branch to merged
Note: See TracTickets for help on using tickets.