diff --git a/.pick_status.json b/.pick_status.json index e0b9a6edaeb..50fbb71a4e7 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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 diff --git a/src/freedreno/ir3/ir3_compiler.c b/src/freedreno/ir3/ir3_compiler.c index 317748c5f92..ae631d478a3 100644 --- a/src/freedreno/ir3/ir3_compiler.c +++ b/src/freedreno/ir3/ir3_compiler.c @@ -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; diff --git a/src/intel/common/intel_measure.c b/src/intel/common/intel_measure.c index 24feb37e35d..daa3287e442 100644 --- a/src/intel/common/intel_measure.c +++ b/src/intel/common/intel_measure.c @@ -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) { diff --git a/src/util/perf/u_trace.c b/src/util/perf/u_trace.c index 2be5f226b00..6d9982cb59c 100644 --- a/src/util/perf/u_trace.c +++ b/src/util/perf/u_trace.c @@ -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); diff --git a/src/util/u_debug.h b/src/util/u_debug.h index e1a3113d92f..dff5db17bc5 100644 --- a/src/util/u_debug.h +++ b/src/util/u_debug.h @@ -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) \