From: Adrien Mazarguil Date: Fri, 18 May 2018 13:55:35 +0000 (+0200) Subject: eal: fix runtime directory permissions X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=97c228a0aa9eea904d2e443a1316abc59dce5783;p=dpdk.git eal: fix runtime 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") Signed-off-by: Adrien Mazarguil --- diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index 7f8475eac7..dc279542d0 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 150d5dd139..8655b86915 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));