util: rename __check_suid() to __normal_user()

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27346>
(cherry picked from commit 3e00558ef00d76a32843fc08eae8d1ba22428ad5)
This commit is contained in:
Eric Engestrom 2024-01-29 12:46:29 +00:00 committed by Eric Engestrom
parent ce8c959664
commit d1b2c4152e
5 changed files with 7 additions and 7 deletions

View file

@ -1004,7 +1004,7 @@
"description": "util: rename __check_suid() to __normal_user()",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -133,7 +133,7 @@ ir3_compiler_create(struct fd_device *dev, const struct fd_dev_id *dev_id,
ir3_shader_debug = debug_get_option_ir3_shader_debug();
ir3_shader_override_path =
!__check_suid() ? debug_get_option_ir3_shader_override_path() : NULL;
__normal_user() ? debug_get_option_ir3_shader_override_path() : NULL;
if (ir3_shader_override_path) {
ir3_shader_debug |= IR3_DBG_NOCACHE;

View file

@ -108,7 +108,7 @@ intel_measure_init(struct intel_measure_device *device)
*sep = '\0';
}
if (filename && !__check_suid()) {
if (filename && __normal_user()) {
filename += 5;
config.file = fopen(filename, "w");
if (!config.file) {

View file

@ -385,7 +385,7 @@ u_trace_state_init_once(void)
u_trace_state.enabled_traces =
debug_get_flags_option("MESA_GPU_TRACES", config_control, 0);
const char *tracefile_name = debug_get_option_trace_file();
if (tracefile_name && !__check_suid()) {
if (tracefile_name && __normal_user()) {
u_trace_state.trace_file = fopen(tracefile_name, "w");
if (u_trace_state.trace_file != NULL) {
atexit(trace_file_fini);

View file

@ -394,13 +394,13 @@ debug_get_option_ ## suffix (void) \
}
static inline bool
__check_suid(void)
__normal_user(void)
{
#if !defined(_WIN32)
if (geteuid() != getuid())
return true;
return false;
#endif
return false;
return true;
}
#define DEBUG_GET_ONCE_BOOL_OPTION(sufix, name, dfault) \