From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id CBE682952 for ; Wed, 2 Nov 2016 11:20:47 +0100 (CET) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP; 02 Nov 2016 03:20:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,583,1473145200"; d="scan'208";a="26465604" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by fmsmga006.fm.intel.com with ESMTP; 02 Nov 2016 03:20:46 -0700 From: Yuanhan Liu To: Reshma Pattan Date: Wed, 2 Nov 2016 18:20:58 +0800 Message-Id: <1478082097-16957-2-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1478082097-16957-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1478082097-16957-1-git-send-email-yuanhan.liu@linux.intel.com> Cc: Jianfeng Tan , dpdk stable , Remy Horton Subject: [dpdk-stable] patch 'pdump: fix created directory permissions' has been queued to stable release 16.07.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Nov 2016 10:20:48 -0000 Hi, FYI, your patch has been queued to stable release 16.07.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/06/16. So please shout if anyone has objections. Thanks. --yliu --- >>From e99f9b26ecd7ae869f507e8f70eaacc4e262b277 Mon Sep 17 00:00:00 2001 From: Reshma Pattan Date: Mon, 10 Oct 2016 15:35:48 +0100 Subject: [PATCH] pdump: fix created directory permissions [ upstream commit 1a0c9cb015b89ba0616f72e706a597805d5b955f ] Inside the function pdump_get_socket_path(), pdump socket directories are created using mkdir() call with permissions 700, which was assigning wrong permissions to the directories i.e. "d-w-r-xr-T" instead of drwx---. The reason is mkdir() call doesn't consider 700 as an octal value until unless 0 is explicitly added before the value. Because of this, socket creation failure is observed when DPDK application was ran in non root user mode. DPDK application running in root user mode never reported the issue. So 0 is prefixed to the value to create directories with the correct permissions. Fixes: e4ffa2d3 ("pdump: fix error handlings") Fixes: bdd8dcc6 ("pdump: fix default socket path") Reported-by: Jianfeng Tan Signed-off-by: Reshma Pattan Acked-by: Remy Horton --- lib/librte_pdump/rte_pdump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c index 9b921ce..ea5ccd9 100644 --- a/lib/librte_pdump/rte_pdump.c +++ b/lib/librte_pdump/rte_pdump.c @@ -471,12 +471,12 @@ pdump_get_socket_path(char *buffer, int bufsz, enum rte_pdump_socktype type) snprintf(dpdk_dir, sizeof(dpdk_dir), "%s%s", SOCKET_PATH_VAR_RUN, DPDK_DIR); - mkdir(dpdk_dir, 700); + mkdir(dpdk_dir, 0700); snprintf(dir, sizeof(dir), "%s%s", dpdk_dir, SOCKET_DIR); } - ret = mkdir(dir, 700); + ret = mkdir(dir, 0700); /* if user passed socket path is invalid, return immediately */ if (ret < 0 && errno != EEXIST) { RTE_LOG(ERR, PDUMP, -- 1.9.0