aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/builtin-annotate.c4
-rw-r--r--tools/perf/builtin-report.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 4ac618b34254..4c7bc4436236 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -984,8 +984,8 @@ static int __cmd_annotate(void)
984 exit(-1); 984 exit(-1);
985 } 985 }
986 986
987 if (!force && (input_stat.st_uid != geteuid())) { 987 if (!force && input_stat.st_uid && (input_stat.st_uid != geteuid())) {
988 fprintf(stderr, "file: %s not owned by current user\n", input_name); 988 fprintf(stderr, "file: %s not owned by current user or root\n", input_name);
989 exit(-1); 989 exit(-1);
990 } 990 }
991 991
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index d2e28820ee60..ea6328a893cc 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -1405,8 +1405,8 @@ static int __cmd_report(void)
1405 exit(-1); 1405 exit(-1);
1406 } 1406 }
1407 1407
1408 if (!force && (input_stat.st_uid != geteuid())) { 1408 if (!force && input_stat.st_uid && (input_stat.st_uid != geteuid())) {
1409 fprintf(stderr, "file: %s not owned by current user\n", input_name); 1409 fprintf(stderr, "file: %s not owned by current user or root\n", input_name);
1410 exit(-1); 1410 exit(-1);
1411 } 1411 }
1412 1412