aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol.c
diff options
context:
space:
mode:
authorVasiliy Kulikov <segoon@openwall.com>2011-08-11 16:55:37 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-08-12 07:28:17 -0400
commite9b52ef2228cd0bed7a4465c693a39489e2c338d (patch)
tree5a3ea5c427fc93cbdf48b383a8a7d37e7cac567f /tools/perf/util/symbol.c
parentf57b05ed532ccf3b3e22878a5678ca10de50ad29 (diff)
perf: fix temporary file ownership check
A file in /tmp/ might be a symlink, so lstat() should be used instead of stat(). Acked-by: Pekka Enberg <penberg@kernel.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Pekka Enberg <penberg@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20110811205537.GA22864@albatros Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r--tools/perf/util/symbol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index e142c21ae9a5..469c0264ed29 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1506,7 +1506,7 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
1506 if (strncmp(dso->name, "/tmp/perf-", 10) == 0) { 1506 if (strncmp(dso->name, "/tmp/perf-", 10) == 0) {
1507 struct stat st; 1507 struct stat st;
1508 1508
1509 if (stat(dso->name, &st) < 0) 1509 if (lstat(dso->name, &st) < 0)
1510 return -1; 1510 return -1;
1511 1511
1512 if (st.st_uid && (st.st_uid != geteuid())) { 1512 if (st.st_uid && (st.st_uid != geteuid())) {