Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tools/perf/util/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ static int perf_config_set__init(struct perf_config_set *set)
if (perf_config_global() && home) {
char *user_config = strdup(mkpath("%s/.perfconfig", home));
struct stat st;
unsigned int st_euid = geteuid();

if (user_config == NULL) {
warning("Not enough memory to process %s/.perfconfig, "
Expand All @@ -629,7 +630,7 @@ static int perf_config_set__init(struct perf_config_set *set)
if (stat(user_config, &st) < 0)
goto out_free;

if (st.st_uid && (st.st_uid != geteuid())) {
if (st.st_uid && st_euid && (st.st_uid != st_euid)) {
warning("File %s not owned by current user or root, "
"ignoring it.", user_config);
goto out_free;
Expand Down