mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-18 07:08:18 +00:00
rump_fs/fuse_fs/lx_fs/ram_fs: symlink fixup
Allow symlinks to be passed to the read and write file system utilities. Disallow writes to symlinks with offsets in file system servers, this is to ensure that writing the target of a symlink is an atomic operation. Fixes #1604
This commit is contained in:
committed by
Norman Feske
parent
b60f28bee9
commit
2f1db06deb
@ -39,6 +39,9 @@ class File_system::Symlink : public Node
|
||||
|
||||
size_t write(char const *src, size_t len, seek_off_t seek_offset)
|
||||
{
|
||||
/* Ideal symlink operations are atomic. */
|
||||
if (seek_offset) return 0;
|
||||
|
||||
size_t count = min(len, sizeof(_link_to) + 1);
|
||||
Genode::strncpy(_link_to, src, count);
|
||||
return count;
|
||||
|
Reference in New Issue
Block a user