Skip to content

aoc: you can create a folder with the same name as a link, shadowing the linked folder #198

@junkimu

Description

@junkimu

Suppose you have a folder shared with you called test1:

ascli aoc files browse /
+-------+------+----------------+------+----------------------+--------------+
| name  | type | recursive_size | size | modified_time        | access_level |
+-------+------+----------------+------+----------------------+--------------+
| test1 | link |                |      | 2023-05-08T23:44:57Z | edit         |
+-------+------+----------------+------+----------------------+--------------+

You can still create a new folder called test1

ascli aoc files mkdir /test1

and end up with something like

ascli aoc files browse /
+-------+--------+----------------+------+----------------------+--------------+
| name  | type   | recursive_size | size | modified_time        | access_level |
+-------+--------+----------------+------+----------------------+--------------+
| test1 | folder | 0              |      | <null>               | edit         |
| test1 | link   |                |      | 2023-05-08T23:44:57Z | edit         |
+-------+--------+----------------+------+----------------------+--------------+

The newly created folder shadows the link, and the original linked folder is no longer accessible.

It is easy to get into this state because ascli's mkdir is not recursive. If you wanted to create /test1/test2/test3, you have to first ensure all parent directories exist, and a natural way of doing that would be to mkdir /test1 then /test1/test2, and finally /test1/test2/test3. But if /test1 was a link, then you will end up creating test2/test3 inside a newly created test1 folder instead of in the linked test1 as expected.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions