Skip to content

va: use secure_getenv instead of getenv in va_x11.c#876

Open
XinfengZhang wants to merge 1 commit intointel:masterfrom
XinfengZhang:getenv
Open

va: use secure_getenv instead of getenv in va_x11.c#876
XinfengZhang wants to merge 1 commit intointel:masterfrom
XinfengZhang:getenv

Conversation

@XinfengZhang
Copy link
Contributor

Move the secure_getenv fallback from va.c to va_internal.h so it is available to all internal callers, and replace the plain getenv call in va_x11.c with secure_getenv. This prevents environment variables from influencing behavior in setuid/setgid programs.

@XinfengZhang XinfengZhang force-pushed the getenv branch 2 times, most recently from 3bca966 to d697564 Compare March 25, 2026 03:17
Move the secure_getenv fallback from va.c to va_internal.h so it is
available to all internal callers, and replace the plain getenv call
in va_x11.c with secure_getenv. On Windows, secure_getenv is defined
as getenv since there is no setuid/setgid concept. This prevents
environment variables from influencing behavior in setuid/setgid
programs on Linux.

Signed-off-by: Carl.Zhang <carl.zhang@intel.com>
@XinfengZhang XinfengZhang force-pushed the getenv branch 2 times, most recently from bd07123 to 7eb117a Compare March 25, 2026 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant