From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id DA80B2A6C; Thu, 9 Aug 2018 17:23:33 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Aug 2018 08:23:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,215,1531810800"; d="scan'208";a="63871972" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.223]) by orsmga008.jf.intel.com with ESMTP; 09 Aug 2018 08:23:27 -0700 From: Bruce Richardson To: thomas@monjalon.net Cc: dev@dpdk.org, Bruce Richardson , stable@dpdk.org Date: Thu, 9 Aug 2018 16:22:35 +0100 Message-Id: <20180809152235.45376-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-stable] [PATCH] mk: fix permissions when using make install X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 15:23:34 -0000 When using make install, the permissions of the resulting file should be those of the user using make install, not those of the user who ran the build. This would not be the case when a user explicitly runs: "make && sudo make install" Fix this by changing "cp -a", which preserves all attributes, to "cp -dR --preserve=timestamp", and by adding the flags "--no-same-owner --no-same-permissions" to the calls to tar. Fixes: 1fa0fd9d6b42 ("mk: allow to specify DESTDIR in build rule") Fixes: 6b62a72a70d0 ("mk: install a standard cutomizable tree") Fixes: 576de42b83e5 ("doc: render and install man pages") CC: stable@dpdk.org Signed-off-by: Bruce Richardson --- mk/rte.sdkinstall.mk | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk index e756ec629..8296e6dbd 100644 --- a/mk/rte.sdkinstall.mk +++ b/mk/rte.sdkinstall.mk @@ -85,18 +85,22 @@ else @echo Installation in $(DESTDIR)$(prefix)/ complete endif +# when installing we want recursive copies preserving timestamps only, no +# preservation of user/group ids or permissions +CP_FLAGS=-dR --preserve=timestamps +TAR_X_FLAGS=--strip-components=1 --keep-newer-files --no-same-owner --no-same-permissions + install-runtime: $(Q)$(call rte_mkdir, $(DESTDIR)$(libdir)) - $(Q)cp -a $O/lib/* $(DESTDIR)$(libdir) + $(Q)cp $(CP_FLAGS) $O/lib/* $(DESTDIR)$(libdir) $(Q)$(call rte_mkdir, $(DESTDIR)$(bindir)) $(Q)tar -cf - -C $O --exclude 'app/*.map' \ --exclude app/dpdk-pmdinfogen \ --exclude 'app/cmdline*' --exclude app/test \ --exclude app/testacl --exclude app/testpipeline app | \ - tar -xf - -C $(DESTDIR)$(bindir) --strip-components=1 \ - --keep-newer-files + tar -xf - -C $(DESTDIR)$(bindir) $(TAR_X_FLAGS) $(Q)$(call rte_mkdir, $(DESTDIR)$(datadir)) - $(Q)cp -a $(RTE_SDK)/usertools $(DESTDIR)$(datadir) + $(Q)cp $(CP_FLAGS) $(RTE_SDK)/usertools $(DESTDIR)$(datadir) $(Q)$(call rte_mkdir, $(DESTDIR)$(sbindir)) $(Q)$(call rte_symlink, $(DESTDIR)$(datadir)/usertools/dpdk-devbind.py, \ $(DESTDIR)$(sbindir)/dpdk-devbind) @@ -104,30 +108,29 @@ install-runtime: $(DESTDIR)$(bindir)/dpdk-pmdinfo) ifneq ($(wildcard $O/doc/man/*/*.1),) $(Q)$(call rte_mkdir, $(DESTDIR)$(mandir)/man1) - $(Q)cp -a $O/doc/man/*/*.1 $(DESTDIR)$(mandir)/man1 + $(Q)cp $(CP_FLAGS) $O/doc/man/*/*.1 $(DESTDIR)$(mandir)/man1 endif ifneq ($(wildcard $O/doc/man/*/*.8),) $(Q)$(call rte_mkdir, $(DESTDIR)$(mandir)/man8) - $(Q)cp -a $O/doc/man/*/*.8 $(DESTDIR)$(mandir)/man8 + $(Q)cp $(CP_FLAGS) $O/doc/man/*/*.8 $(DESTDIR)$(mandir)/man8 endif install-kmod: ifneq ($(wildcard $O/kmod/*),) $(Q)$(call rte_mkdir, $(DESTDIR)$(kerneldir)) - $(Q)cp -a $O/kmod/* $(DESTDIR)$(kerneldir) + $(Q)cp $(CP_FLAGS) $O/kmod/* $(DESTDIR)$(kerneldir) endif install-sdk: $(Q)$(call rte_mkdir, $(DESTDIR)$(includedir)) $(Q)tar -chf - -C $O include | \ - tar -xf - -C $(DESTDIR)$(includedir) --strip-components=1 \ - --keep-newer-files + tar -xf - -C $(DESTDIR)$(includedir) $(TAR_X_FLAGS) $(Q)$(call rte_mkdir, $(DESTDIR)$(sdkdir)) - $(Q)cp -a $(RTE_SDK)/mk $(DESTDIR)$(sdkdir) - $(Q)cp -a $(RTE_SDK)/buildtools $(DESTDIR)$(sdkdir) + $(Q)cp $(CP_FLAGS) $(RTE_SDK)/mk $(DESTDIR)$(sdkdir) + $(Q)cp $(CP_FLAGS) $(RTE_SDK)/buildtools $(DESTDIR)$(sdkdir) $(Q)$(call rte_mkdir, $(DESTDIR)$(targetdir)/app) - $(Q)cp -a $O/.config $(DESTDIR)$(targetdir) - $(Q)cp -a $O/app/dpdk-pmdinfogen $(DESTDIR)$(targetdir)/app + $(Q)cp $(CP_FLAGS) $O/.config $(DESTDIR)$(targetdir) + $(Q)cp $(CP_FLAGS) $O/app/dpdk-pmdinfogen $(DESTDIR)$(targetdir)/app $(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(targetdir)/include) $(Q)$(call rte_symlink, $(DESTDIR)$(libdir), $(DESTDIR)$(targetdir)/lib) @@ -135,12 +138,11 @@ install-doc: ifneq ($(wildcard $O/doc/html),) $(Q)$(call rte_mkdir, $(DESTDIR)$(docdir)) $(Q)tar -cf - -C $O/doc --exclude 'html/guides/.*' html | \ - tar -xf - -C $(DESTDIR)$(docdir) --strip-components=1 \ - --keep-newer-files + tar -xf - -C $(DESTDIR)$(docdir) $(TAR_X_FLAGS) endif ifneq ($(wildcard $O/doc/*/*/*pdf),) $(Q)$(call rte_mkdir, $(DESTDIR)$(docdir)/guides) - $(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides + $(Q)cp $(CP_FLAGS) $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides endif $(Q)$(call rte_mkdir, $(DESTDIR)$(datadir)) - $(Q)cp -a $(RTE_SDK)/examples $(DESTDIR)$(datadir) + $(Q)cp $(CP_FLAGS) $(RTE_SDK)/examples $(DESTDIR)$(datadir) -- 2.17.1