Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9b52ef2 authored by Vasiliy Kulikov's avatar Vasiliy Kulikov Committed by Arnaldo Carvalho de Melo
Browse files

perf: fix temporary file ownership check



A file in /tmp/ might be a symlink, so lstat() should be used instead of
stat().

Acked-by: default avatarPekka 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: default avatarVasiliy Kulikov <segoon@openwall.com>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent f57b05ed
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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())) {