[haiku-bugs] Re: [Haiku] #8321: Symbolic link is followed when replacing a file!

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Sun, 12 Feb 2012 01:34:04 -0000

#8321: Symbolic link is followed when replacing a file!
----------------------------+----------------------------
   Reporter:  Pete          |      Owner:  nobody
       Type:  bug           |     Status:  new
   Priority:  normal        |  Milestone:  R1
  Component:  Applications  |    Version:  R1/Development
 Resolution:                |   Keywords:
 Blocked By:                |   Blocking:
Has a Patch:  0             |   Platform:  All
----------------------------+----------------------------
Changes (by bonefish):

 * owner:  axeld => nobody
 * component:  Kits/Storage Kit => Applications


Comment:

 This really doesn't have anything to do with the storage kit. `BFilePanel`
 is in libtracker, if that's what you're thinking of.

 I don't find your proposed text helpful at all, though. I believe the
 expected "Save as" logic is rather obvious: The application should replace
 the entry that the user selected, regardless of whether it is a symlink or
 a file. I would only change the file panel's alert text to use more
 correct phrasing in case of a symlink and maybe -- the phrasing in my
 earlier comment might have been misunderstandable -- add a third option to
 the alert to overwrite the file (i.e. there would be three instead of two
 options: "Cancel", "Overwrite symlink", "Overwrite file"). I'm not sure,
 if this is really necessary, though, since -- as written above -- I would
 find the obvious behavior to replace the symlink (why choose the symlink
 when you want to replace the referred to file?).

 The "Save" behavior in case of opening a symlink is obvious, too: The
 actually opened file should be replaced. Actually the application should
 already explicitly resolve the symlink when opening (which would also be
 reflected in the document file path (e.g. in the window title)), so this
 isn't even a special case when saving.

 In either case the application should use the safe method of saving: save
 in new file + remove old file + rename new file. In the "Save" case
 attributes need to be preserved (i.e. copied), which is where Pe
 apparently misbehaves a bit.

 Changing the component to "Applications", since that's where the main
 changes need to happen.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/8321#comment:8>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: