Skip to content

Commit

Permalink
perf: fix temporary file ownership check
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
segoon authored and acmel committed Aug 12, 2011
1 parent f57b05e commit e9b52ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/perf/util/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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())) {
Expand Down

0 comments on commit e9b52ef

Please sign in to comment.