Commit 119e7a22 authored by Pierre Habouzit's avatar Pierre Habouzit Committed by Ingo Molnar

perf tools: do not complain if root is owning perf.data

This improves patch fa6963b2 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: default avatarPierre 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: default avatarIngo Molnar <mingo@elte.hu>
parent 7ced156b
...@@ -984,8 +984,8 @@ static int __cmd_annotate(void) ...@@ -984,8 +984,8 @@ static int __cmd_annotate(void)
exit(-1); exit(-1);
} }
if (!force && (input_stat.st_uid != geteuid())) { if (!force && input_stat.st_uid && (input_stat.st_uid != geteuid())) {
fprintf(stderr, "file: %s not owned by current user\n", input_name); fprintf(stderr, "file: %s not owned by current user or root\n", input_name);
exit(-1); exit(-1);
} }
......
...@@ -1405,8 +1405,8 @@ static int __cmd_report(void) ...@@ -1405,8 +1405,8 @@ static int __cmd_report(void)
exit(-1); exit(-1);
} }
if (!force && (input_stat.st_uid != geteuid())) { if (!force && input_stat.st_uid && (input_stat.st_uid != geteuid())) {
fprintf(stderr, "file: %s not owned by current user\n", input_name); fprintf(stderr, "file: %s not owned by current user or root\n", input_name);
exit(-1); exit(-1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment