mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 02:02:14 +02:00
dnd kitten: Create regular files with O_EXCL to avoid symlink attacks
This is not really needed as the terminal emulator should be de duplicating directory entries anyway but no harm in defense in depth.
This commit is contained in:
@@ -823,7 +823,7 @@ func (dnd *dnd) on_remote_drop_data(cmd DC) (err error) {
|
||||
e.item_type = cmd.Xp
|
||||
switch cmd.Xp {
|
||||
case 0:
|
||||
f, err := utils.CreateAt(e.base_dir.handle, e.name, 0o666)
|
||||
f, err := utils.CreateExclusiveAt(e.base_dir.handle, e.name, 0o666)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user