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:
Emery Hemingway
2015-06-27 15:50:49 -05:00
committed by Norman Feske
parent b60f28bee9
commit 2f1db06deb
5 changed files with 15 additions and 5 deletions

View File

@ -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;