Ticket #82 (closed defect: fixed)
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: | Editor | Severity: | 3 - Normal |
Status: | None | Privacy: | Public |
Assigned to: | None | Open/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.
Attachments
Change History
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:6 Changed 15 years ago by slyfox
Sorry, clickable link: changeset:65771004c4948dd664674e8dee2ddce11786d777
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: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.
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: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