mirror of
https://github.com/genesi/linux-legacy.git
synced 2026-02-03 23:04:38 +00:00
perf tools: do not complain if root is owning perf.data
commit 119e7a22bb70d84849384e5113792cd45afa4f85 upstream.
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>
LKML-Reference: <20090827075902.GF19653@laphroaig.corp>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0f71d95b3a
commit
c37689d1ff
@@ -1335,8 +1335,8 @@ static int __cmd_annotate(void)
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (!force && (stat.st_uid != geteuid())) {
|
||||
fprintf(stderr, "file: %s not owned by current user\n", input_name);
|
||||
if (!force && stat.st_uid && (stat.st_uid != geteuid())) {
|
||||
fprintf(stderr, "file: %s not owned by current user or root\n", input_name);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
||||
@@ -1857,8 +1857,8 @@ static int __cmd_report(void)
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (!force && (stat.st_uid != geteuid())) {
|
||||
fprintf(stderr, "file: %s not owned by current user\n", input_name);
|
||||
if (!force && stat.st_uid && (stat.st_uid != geteuid())) {
|
||||
fprintf(stderr, "file: %s not owned by current user or root\n", input_name);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user