public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] perf daemon: Fix control fifo permissions
@ 2021-03-01 12:25 Jiri Olsa
  2021-03-01 12:25 ` [PATCH 2/2] perf daemon: Allow test for non root user Jiri Olsa
  2021-03-02 12:59 ` [PATCH 1/2] perf daemon: Fix control fifo permissions Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Olsa @ 2021-03-01 12:25 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, Peter Zijlstra, Ingo Molnar, Mark Rutland, Namhyung Kim,
	Alexander Shishkin, Michael Petlan, Ian Rogers, John Garry

Add proper mode for mkfifo calls to get read and
write permissions for user. We can't use O_RDWR
in here, changing to standard permission value.

Fixes: 6a6d1804a190 ("perf daemon: Set control fifo for session")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/builtin-daemon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-daemon.c b/tools/perf/builtin-daemon.c
index 617feaf020f6..8f0ed2e59280 100644
--- a/tools/perf/builtin-daemon.c
+++ b/tools/perf/builtin-daemon.c
@@ -373,12 +373,12 @@ static int daemon_session__run(struct daemon_session *session,
 	dup2(fd, 2);
 	close(fd);
 
-	if (mkfifo(SESSION_CONTROL, O_RDWR) && errno != EEXIST) {
+	if (mkfifo(SESSION_CONTROL, 0600) && errno != EEXIST) {
 		perror("failed: create control fifo");
 		return -1;
 	}
 
-	if (mkfifo(SESSION_ACK, O_RDWR) && errno != EEXIST) {
+	if (mkfifo(SESSION_ACK, 0600) && errno != EEXIST) {
 		perror("failed: create ack fifo");
 		return -1;
 	}
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-02 15:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-01 12:25 [PATCH 1/2] perf daemon: Fix control fifo permissions Jiri Olsa
2021-03-01 12:25 ` [PATCH 2/2] perf daemon: Allow test for non root user Jiri Olsa
2021-03-02 12:59 ` [PATCH 1/2] perf daemon: Fix control fifo permissions Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox