1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

Kernel+LibC+LibCore+UE: Implement fchmodat(2)

This function is an extended version of `chmod(2)` that lets one control
whether to dereference symlinks, and specify a file descriptor to a
directory that will be used as the base for relative paths.
This commit is contained in:
Daniel Bertalan 2022-01-11 16:51:34 +01:00 committed by Andreas Kling
parent 5f71925aa4
commit 182016d7c0
10 changed files with 64 additions and 14 deletions

View file

@ -434,9 +434,9 @@ ErrorOr<void> VirtualFileSystem::chmod(Custody& custody, mode_t mode)
return inode.chmod(mode);
}
ErrorOr<void> VirtualFileSystem::chmod(StringView path, mode_t mode, Custody& base)
ErrorOr<void> VirtualFileSystem::chmod(StringView path, mode_t mode, Custody& base, int options)
{
auto custody = TRY(resolve_path(path, base));
auto custody = TRY(resolve_path(path, base, nullptr, options));
return chmod(custody, mode);
}

View file

@ -57,7 +57,7 @@ public:
ErrorOr<void> unlink(StringView path, Custody& base);
ErrorOr<void> symlink(StringView target, StringView linkpath, Custody& base);
ErrorOr<void> rmdir(StringView path, Custody& base);
ErrorOr<void> chmod(StringView path, mode_t, Custody& base);
ErrorOr<void> chmod(StringView path, mode_t, Custody& base, int options = 0);
ErrorOr<void> chmod(Custody&, mode_t);
ErrorOr<void> chown(StringView path, UserID, GroupID, Custody& base, int options);
ErrorOr<void> chown(Custody&, UserID, GroupID);