1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:57:44 +00:00

LibCore: Implement File::can_delete_or_move()

Besides from a general check if a file's directory has write
permissions, this also checks if the directory has set a sticky bit,
meaning that only file owners and the directory owner can remove or move
files in such directory. It's being used in /tmp for example.
This commit is contained in:
Karol Kosek 2022-08-31 22:07:16 +02:00 committed by Linus Groh
parent 8cfd445c23
commit b810f7f88a
2 changed files with 28 additions and 0 deletions

View file

@ -53,6 +53,7 @@ public:
static ErrorOr<size_t> size(DeprecatedString const& filename);
static DeprecatedString current_working_directory();
static DeprecatedString absolute_path(DeprecatedString const& path);
static bool can_delete_or_move(StringView path);
enum class RecursionMode {
Allowed,