mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 06:37:52 +00:00
Kernel+Userland: Add symlink() syscall and add "-s" flag to /bin/ln.
It's now possible to create symbolic links! :^) This exposed an issue in Ext2FS where we'd write uninitialized data past the end of an inode's content. Fix this by zeroing out the tail end of the last block in a file.
This commit is contained in:
@@ -2144,6 +2144,15 @@ int Process::sys$unlink(const char* pathname)
|
||||
return VFS::the().unlink(String(pathname), cwd_inode());
|
||||
}
|
||||
|
||||
int Process::sys$symlink(const char* target, const char* linkpath)
|
||||
{
|
||||
if (!validate_read_str(target))
|
||||
return -EFAULT;
|
||||
if (!validate_read_str(linkpath))
|
||||
return -EFAULT;
|
||||
return VFS::the().symlink(String(target), String(linkpath), cwd_inode());
|
||||
}
|
||||
|
||||
int Process::sys$rmdir(const char* pathname)
|
||||
{
|
||||
if (!validate_read_str(pathname))
|
||||
|
||||
Reference in New Issue
Block a user