Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1229998 > unrolled thread

[PATCH] perf report: fix owner error when reading perf.data

Started byTaeung Song <treeze.taeung@gmail.com>
First post2015-09-22 11:20 +0200
Last post2015-09-22 11:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] perf report: fix owner error when reading perf.data Taeung Song <treeze.taeung@gmail.com> - 2015-09-22 11:20 +0200

#1229998 — [PATCH] perf report: fix owner error when reading perf.data

FromTaeung Song <treeze.taeung@gmail.com>
Date2015-09-22 11:20 +0200
Subject[PATCH] perf report: fix owner error when reading perf.data
Message-ID<qbrTY-12G-11@gated-at.bofh.it>
If perf.data file is owned by some user,
it can't be read even if current user is root.
So, add a condition (if root) to skip the owner error
handling if statement.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
---
 tools/perf/util/data.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c
index 1921942..20632a5 100644
--- a/tools/perf/util/data.c
+++ b/tools/perf/util/data.c
@@ -67,7 +67,7 @@ static int open_file_read(struct perf_data_file *file)
 	if (fstat(fd, &st) < 0)
 		goto out_close;
 
-	if (!file->force && st.st_uid && (st.st_uid != geteuid())) {
+	if (!file->force && geteuid() && st.st_uid && (st.st_uid != geteuid())) {
 		pr_err("File %s not owned by current user or root (use -f to override)\n",
 		       file->path);
 		goto out_close;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web