From 061d2ed1a2831e98270c30dec531a63b37251fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 31 Jul 2009 00:40:52 +0000 Subject: [PATCH] * Creating a symlink now fails with B_NOT_SUPPORTED instead of B_READ_ONLY_DEVICE if it has a write hook. * This fixes bug #4141. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32004 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/fs/vfs.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp index 5f399090b6..5d10bd4da7 100644 --- a/src/system/kernel/fs/vfs.cpp +++ b/src/system/kernel/fs/vfs.cpp @@ -5939,16 +5939,19 @@ common_create_symlink(int fd, char* path, const char* toPath, int mode, struct vnode* vnode; status_t status; - FUNCTION(("common_create_symlink(fd = %d, path = %s, toPath = %s, mode = %d, kernel = %d)\n", fd, path, toPath, mode, kernel)); + FUNCTION(("common_create_symlink(fd = %d, path = %s, toPath = %s, " + "mode = %d, kernel = %d)\n", fd, path, toPath, mode, kernel)); status = fd_and_path_to_dir_vnode(fd, path, &vnode, name, kernel); - if (status < B_OK) + if (status != B_OK) return status; if (HAS_FS_CALL(vnode, create_symlink)) status = FS_CALL(vnode, create_symlink, name, toPath, mode); - else - status = EROFS; + else { + status = HAS_FS_CALL(vnode, write) + ? B_NOT_SUPPORTED : B_READ_ONLY_DEVICE; + } put_vnode(vnode);