util: rename __check_suid() to __normal_user()

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27346>
This commit is contained in:
Eric Engestrom 2024-01-29 12:46:29 +00:00 committed by Marge Bot
parent 2d91b870fb
commit 3e00558ef0
4 changed files with 6 additions and 6 deletions

View file

@ -135,7 +135,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) \