Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions fs/vfs/fs_pseudofile.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,10 @@ int pseudofile_create(FAR struct inode **node, FAR const char *path,
mode_t mode)
{
FAR struct fs_pseudofile_s *pf;
#if defined(CONFIG_PSEUDOFS_ATTRIBUTES) && \
defined(CONFIG_SCHED_USER_IDENTITY)
FAR struct tcb_s *rtcb;
#endif
int ret;

if (node == NULL || path == NULL)
Expand All @@ -493,6 +497,18 @@ int pseudofile_create(FAR struct inode **node, FAR const char *path,
(*node)->i_flags = 1;
(*node)->u.i_ops = &g_pseudofile_ops;
(*node)->i_private = pf;

#if defined(CONFIG_PSEUDOFS_ATTRIBUTES) && \
defined(CONFIG_SCHED_USER_IDENTITY)

rtcb = nxsched_self();
if (rtcb != NULL && rtcb->group != NULL)
{
(*node)->i_owner = rtcb->group->tg_euid;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's better to move the initialize into inode_reserve

(*node)->i_group = rtcb->group->tg_egid;
}
#endif

atomic_fetch_add(&(*node)->i_crefs, 1);

inode_unlock();
Expand Down
Loading