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

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Thu, 09 Feb 2012 12:39:18 -0000

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

 * owner:  axeld => korli
 * version:  R1/alpha3 => R1/Development
 * component:  Kits/Storage Kit => Applications/StyledEdit


Comment:

 At the first glance I would say that is StyledEdit's fault. The way it
 [http://cgit.haiku-
 os.org/haiku/tree/src/apps/stylededit/StyledEditWindow.cpp#n677 opens the
 file] is supposed to traverse symlinks (according to the BeBook).
 Theoretically `O_NOTRAVERSE` or `O_NOFOLLOW` could be specified
 (undocumented in the BeBook), but that would only make the operation fail,
 not replace the symlink. So the entry returned by `BFilePanel` would first
 have to be checked explicitly. Even better, the saving procedure should
 play it safe and first write to another file and, only if that succeeded,
 replace the old one.

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

Other related posts: