Skip to contentSkip to conversation

eal: fix directory permissions

PATCH Applied Adrien Mazarguil 2 participants 2 messages May 18, 2018 – May 20, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eal: fix directory permissions

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 <[email protected]>
---
 lib/librte_eal/bsdapp/eal/eal.c   | 4 ++--
 lib/librte_eal/linuxapp/eal/eal.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
lib/librte_eal/bsdapp/eal/eal.c +2 -2
index 7f8475eac..dc279542d 100644
@@ -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));
lib/librte_eal/linuxapp/eal/eal.c +2 -2
index 150d5dd13..8655b8691 100644
@@ -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));
Signature · 1 line
2.11.0
#1 lore raw

18/05/2018 15:55, Adrien Mazarguil:

Quoted 11 lines

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 <[email protected]>

Applied, thanks