Abhishekmishra2808 commented on code in PR #19900:
URL: https://github.com/apache/nuttx/pull/19900#discussion_r3837956737
##########
Documentation/implementation/user_identity.rst:
##########
@@ -152,6 +152,19 @@ Configuration
See :ref:`file-permission` for the VFS helpers, mount-crossing
traverse rules, and testing notes.
+Flat Build Trust Boundary
+=========================
+
+This credential model is a DAC layer for cooperating tasks, not a
Review Comment:
Expanded the context for it.
##########
fs/inode/fs_inodesearch.c:
##########
@@ -193,6 +199,120 @@ static int _inode_linktarget(FAR struct inode *inode,
}
#endif
+#ifdef CONFIG_FS_CHROOT
+/****************************************************************************
+ * Name: inode_get_chroot
+ ****************************************************************************/
+
+static FAR struct inode *inode_get_chroot(FAR const char **relpath)
+{
+ FAR struct tcb_s *tcb = nxsched_self();
+
+ if (relpath != NULL)
+ {
+ *relpath = NULL;
+ }
+
+ if (tcb != NULL && tcb->group != NULL && tcb->group->tg_root != NULL)
+ {
+ if (relpath != NULL)
+ {
+ *relpath = tcb->group->tg_rootrel;
+ }
+
+ return tcb->group->tg_root;
+ }
+
+ return g_root_inode;
+}
+
+/****************************************************************************
+ * Name: inode_normalize_abs
+ *
+ * Description:
+ * Normalize an absolute path: drop empty and "." segments, and clamp
+ * ".." at the search root. Needed even before a jail is installed:
+ * chroot(".") becomes "$PWD/.", and if PWD sits under a mountpoint
+ * (tmpfs /tmp) the leftover "." is passed to the filesystem as
+ * relpath and fails with ENOENT.
+ *
+ ****************************************************************************/
Review Comment:
Done
--
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]