Abhishekmishra2808 commented on code in PR #19585:
URL: https://github.com/apache/nuttx/pull/19585#discussion_r3695680805


##########
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:
   Applied as issetugid() ? NULL : getenv(name) - arms were swapped.



-- 
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