xiaoxiang781216 commented on code in PR #19585:
URL: https://github.com/apache/nuttx/pull/19585#discussion_r3695645699
##########
binfmt/binfmt_execmodule.c:
##########
@@ -45,6 +45,7 @@
#include <nuttx/binfmt/binfmt.h>
#include "binfmt.h"
+#include "environ/environ.h"
Review Comment:
please squash your change into one patch
##########
fs/vfs/fs_open.c:
##########
@@ -172,7 +172,19 @@ static int file_vopen(FAR struct file *filep, FAR const
char *path,
/* Validate operation support and pseudo-filesystem permissions */
- ret = inode_checkopenperm(inode, oflags);
+#ifndef CONFIG_DISABLE_MOUNTPOINT
+ if (INODE_IS_MOUNTPT(inode))
+ {
+ ret = inode_checkopenperm(inode, oflags);
+ }
+ else
+#endif
+ {
+ inode_rlock();
Review Comment:
why remove the lock
##########
sched/environ/env_secureexec.c:
##########
@@ -141,29 +116,18 @@ void env_sanitize_secure(FAR struct task_group_s *group)
nxrmutex_unlock(&group->tg_mutex);
}
-#endif /* CONFIG_SCHED_USER_IDENTITY */
+#endif
/****************************************************************************
* Name: secure_getenv
- *
- * Description:
- * Like getenv(), but returns NULL when the task group is executing a
- * secure (set-user-ID or set-group-ID) program image.
- *
****************************************************************************/
FAR char *secure_getenv(FAR const char *name)
{
-#ifdef CONFIG_SCHED_USER_IDENTITY
- FAR struct tcb_s *rtcb;
-
- rtcb = this_task();
- if (rtcb != NULL && rtcb->group != NULL &&
- (rtcb->group->tg_flags & GROUP_FLAG_SECURE_EXEC) != 0)
+ if (issetugid())
Review Comment:
`return issetugid() ? getenv(name) : NULL;`
--
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]