aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasiliy Kulikov <[email protected]>2011-08-12 00:55:37 +0400
committerArnaldo Carvalho de Melo <[email protected]>2011-08-12 08:28:17 -0300
commite9b52ef2228cd0bed7a4465c693a39489e2c338d (patch)
tree5a3ea5c427fc93cbdf48b383a8a7d37e7cac567f
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 <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/20110811205537.GA22864@albatros Signed-off-by: Vasiliy Kulikov <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-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)
if (strncmp(dso->name, "/tmp/perf-", 10) == 0) {
struct stat st;
- if (stat(dso->name, &st) < 0)
+ if (lstat(dso->name, &st) < 0)
return -1;
if (st.st_uid && (st.st_uid != geteuid())) {