SerenityOS/serenity

Everywhere: Audit usages of LexicalPath

Open

#21,450 创建于 2023年10月14日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)C++ (33,171 star) (3,328 fork)batch import
help wanted

描述

Given directory tree

./
  a/
    b/
  e -> a/b

e/.. will refer to a, not .. However, since Directory::create lexically canonicalizes path, running Directory::create("e/..", Directory::CreateDirectories::No) will result in . being opened.

This results in inconsistency between our tar and GNU's tar if ran from . with arguments -cv e/.. -f /dev/null. I'm sure this is not the only place where we assume LexicalPath::canonicalize does not change what path refers to.

Although such resolution is not the most intuitive behavior, I think it should be fixed for the sake of consistency.


I am planning on addressing situation with paths altogether, so I made this issue mostly as a reminder for myself.

贡献者指南