This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 9e7f4cb09047a004ba0158f7e820a05dc9ccfb73
Author: zhengyu16 <[email protected]>
AuthorDate: Thu Nov 12 13:08:43 2026 +0800

    fs/vfs: return EEXIST for symlink() over a link
    
    symlink() looks up path2 with the final symbolic link followed.  When
    path2 is a dangling link the lookup fails with ENOENT and a new node is
    reserved at the same path instead of failing with EEXIST as POSIX
    requires.  Look up path2 without following the final link.
    
    Signed-off-by: zhengyu16 <[email protected]>
    Signed-off-by: jingfei <[email protected]>
---
 fs/vfs/fs_symlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/vfs/fs_symlink.c b/fs/vfs/fs_symlink.c
index 2e8bcabac69..785dc12ed21 100644
--- a/fs/vfs/fs_symlink.c
+++ b/fs/vfs/fs_symlink.c
@@ -99,7 +99,7 @@ int symlink(FAR const char *path1, FAR const char *path2)
    * 'path2' does not lie on a mounted volume.
    */
 
-  ret = inode_search_setup(&desc, path2, false);
+  ret = inode_search_setup(&desc, path2, true);
   if (ret < 0)
     {
       goto errout;

Reply via email to