xiaoxiang781216 commented on code in PR #19900:
URL: https://github.com/apache/nuttx/pull/19900#discussion_r3980802152


##########
fs/vfs/fs_chroot.c:
##########
@@ -98,46 +96,30 @@ int chroot(FAR const char *path)
       return ERROR;
     }
 
-  /* Make the stored root absolute.  The lookups commit replaces this
-   * with inode_search_setup() so nested jails and ".." cannot escape.
+  /* Resolve to a host absolute path the same way lookups do: make
+   * absolute, prepend the current jail, and canonicalize.  No second
+   * inode walk.
    */
 
-  if (path[0] == '/')

Review Comment:
   My suggestion is moving `fs: add chroot() syscall` after `fs: start absolute 
lookups at the jail root` to avoid changing chroot implementation in two 
patches.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to