aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPierre Habouzit <pierre.habouzit@intersec.com>2009-08-27 03:59:02 -0400
committerIngo Molnar <mingo@elte.hu>2009-08-28 07:47:43 -0400
commit119e7a22bb70d84849384e5113792cd45afa4f85 (patch)
treed9a1cb5b125922e33bd39bf62cac4f4679f10634 /tools
parent7ced156bb8bb6363b6ed541871bf19a90273f910 (diff)
perf tools: do not complain if root is owning perf.data
This improves patch fa6963b24 so that perf.data stuff that has been dumped as root can be read (annotate/report) by a user without the use of the --force. Rationale is that root has plenty of ways to screw us (usually) that do not require twisted schemes involving specially crafting a perf.data. Signed-off-by: Pierre Habouzit <pierre.habouzit@intersec.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: <stable@kernel.org> LKML-Reference: <20090827075902.GF19653@laphroaig.corp> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-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