1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-25 01:06:50 +00:00

add O_NOFOLLOW to base flags, see #908

scenario:

- x is a regular file
- borg does stat on x: is a regular file
- so borg dispatches to process_file
- attack: x gets replaced by a symlink (mv symlink x)
- in process_file, borg opens x and must not follow the symlink nor
  continue processing as a normal file, but rather error in open()
  due to NOFOLLOW.
This commit is contained in:
Thomas Waldmann 2019-02-17 05:17:52 +01:00
parent 39922e88e5
commit b4ca919d02

View file

@ -202,7 +202,7 @@ def O_(*flags):
return result
flags_base = O_('BINARY', 'NONBLOCK', 'NOCTTY') # later: add 'NOFOLLOW'
flags_base = O_('BINARY', 'NONBLOCK', 'NOCTTY', 'NOFOLLOW')
flags_normal = flags_base | O_('RDONLY')
flags_noatime = flags_normal | O_('NOATIME')
flags_root = O_('RDONLY')