DPDK patches and discussions
 help / color / mirror / Atom feed
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
To: Anatoly Burakov <anatoly.burakov@intel.com>
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] eal: fix directory permissions
Date: Fri, 18 May 2018 15:55:35 +0200	[thread overview]
Message-ID: <20180518135437.30692-1-adrien.mazarguil@6wind.com> (raw)

Executable bit must be set on directories for normal users to enter them.

This patch addresses the inability to start DPDK applications as non-root
due to errors such as:

 EAL: failed to bind /tmp/dpdk/rte/mp_socket: Permission denied

Fixes: 56236363b481 ("eal: add directory for runtime data")
Cc: Anatoly Burakov <anatoly.burakov@intel.com>

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 lib/librte_eal/bsdapp/eal/eal.c   | 4 ++--
 lib/librte_eal/linuxapp/eal/eal.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index 7f8475eac..dc279542d 100644
--- a/lib/librte_eal/bsdapp/eal/eal.c
+++ b/lib/librte_eal/bsdapp/eal/eal.c
@@ -123,14 +123,14 @@ eal_create_runtime_dir(void)
 	/* create the path if it doesn't exist. no "mkdir -p" here, so do it
 	 * step by step.
 	 */
-	ret = mkdir(tmp, 0600);
+	ret = mkdir(tmp, 0700);
 	if (ret < 0 && errno != EEXIST) {
 		RTE_LOG(ERR, EAL, "Error creating '%s': %s\n",
 			tmp, strerror(errno));
 		return -1;
 	}
 
-	ret = mkdir(runtime_dir, 0600);
+	ret = mkdir(runtime_dir, 0700);
 	if (ret < 0 && errno != EEXIST) {
 		RTE_LOG(ERR, EAL, "Error creating '%s': %s\n",
 			runtime_dir, strerror(errno));
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index 150d5dd13..8655b8691 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -131,14 +131,14 @@ eal_create_runtime_dir(void)
 	/* create the path if it doesn't exist. no "mkdir -p" here, so do it
 	 * step by step.
 	 */
-	ret = mkdir(tmp, 0600);
+	ret = mkdir(tmp, 0700);
 	if (ret < 0 && errno != EEXIST) {
 		RTE_LOG(ERR, EAL, "Error creating '%s': %s\n",
 			tmp, strerror(errno));
 		return -1;
 	}
 
-	ret = mkdir(runtime_dir, 0600);
+	ret = mkdir(runtime_dir, 0700);
 	if (ret < 0 && errno != EEXIST) {
 		RTE_LOG(ERR, EAL, "Error creating '%s': %s\n",
 			runtime_dir, strerror(errno));
-- 
2.11.0

             reply	other threads:[~2018-05-18 13:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-18 13:55 Adrien Mazarguil [this message]
2018-05-20 23:08 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180518135437.30692-1-adrien.mazarguil@6wind.com \
    --to=adrien.mazarguil@6wind.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).