Skip to contentSkip to conversation

package/attr,acl: fix installation

PATCH New Yann E. MORIN 3 participants 6 messages May 8, 2018 – May 28, 2018

lore
Share & tools
lore
#0 lore raw

cover package/attr,acl: fix installation

Hello All!

Fixes bug #10986.

Regards,
Yann E. MORIN.

The following changes since commit ba33728bc3118a6f1d2b4233e7bddb17b2f67f1f

uclibc: fix clock_nanosleep declaration (2018-05-06 23:19:14 +0200)

are available in the git repository at:

git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to 8b860ca93d0672e9d84d2321027f425fce34181d

package/ac: fix install (2018-05-08 15:38:25 +0200)

----------------------------------------------------------------
Yann E. MORIN (2):
package/attr: fix install
package/ac: fix install

 ...-all-use-install-1-to-install-executables.patch | 67 ++++++++++++++++++++++
 ...-all-use-install-1-to-install-executables.patch | 67 ++++++++++++++++++++++
 2 files changed, 134 insertions(+)
 create mode 100644 package/acl/0003-all-use-install-1-to-install-executables.patch
 create mode 100644 package/attr/0004-all-use-install-1-to-install-executables.patch
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH 1/2 package/attr: fix install

Do not overwrite destination file if it exists.

Fixes #10986
Reported-by mzweerspenko+bugzilla at gmail.com
Cc mzweerspenko+bugzilla at gmail.com
---
 ...-all-use-install-1-to-install-executables.patch | 67 ++++++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 package/attr/0004-all-use-install-1-to-install-executables.patch
package/attr/0004-all-use-install-1-to-install-executables.patch new file +67 -0
new file mode 100644
index 0000000000..ef59bb797c
@@ -0,0 +1,67 @@
+From 4187e60ab52cac3ed36036a354977310dab68dcb Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <[email protected]>
+Date: Tue, 8 May 2018 15:16:10 +0200
+Subject: [PATCH] all: use install(1) to install executables
+
+When the destination file already exists, the current install script
+will overwrite it with the new executable.
+
+However, when the existing executable is a symlink or hardlink to
+something else, like busybox, this effectively overwrites that something
+with the new executable, and thus replaces busybox and all its applets
+with the code for either of the three commands.
+
+We fix that by simply calling install(1). install(1) is sufficiently
+widespread that we don't bother checking for it, as this is just a
+workaround while waiting for the version bump that will eventually fix
+it for good.
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+---
+ attr/Makefile     | 4 ++--
+ getfattr/Makefile | 4 ++--
+ setfattr/Makefile | 4 ++--
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/attr/Makefile b/attr/Makefile
+index 1c467e8..326dd7e 100644
+--- a/attr/Makefile
++++ b/attr/Makefile
+@@ -29,6 +29,6 @@ default: $(LTCOMMAND)
+ include $(BUILDRULES)
+ 
+ install: default
+-	$(INSTALL) -m 755 -d $(PKG_BIN_DIR)
+-	$(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)
++	install -D -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)/$(LTCOMMAND)
++
+ install-dev install-lib:
+diff --git a/getfattr/Makefile b/getfattr/Makefile
+index 91d3df2..f913172 100644
+--- a/getfattr/Makefile
++++ b/getfattr/Makefile
+@@ -30,6 +30,6 @@ default: $(LTCOMMAND)
+ include $(BUILDRULES)
+ 
+ install: default
+-	$(INSTALL) -m 755 -d $(PKG_BIN_DIR)
+-	$(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)
++	install -D -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)/$(LTCOMMAND)
++
+ install-dev install-lib:
+diff --git a/setfattr/Makefile b/setfattr/Makefile
+index d55461b..26dc5d8 100644
+--- a/setfattr/Makefile
++++ b/setfattr/Makefile
+@@ -30,6 +30,6 @@ default: $(LTCOMMAND)
+ include $(BUILDRULES)
+ 
+ install: default
+-	$(INSTALL) -m 755 -d $(PKG_BIN_DIR)
+-	$(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)
++	install -D -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)/$(LTCOMMAND)
++
+ install-dev install-lib:
+-- 
+2.14.1
+
Signature · 1 line
2.14.1
#2 lore raw

PATCH 1/2 package/attr: fix install

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Do not overwrite destination file if it exists.
Fixes: #10986

Reported-by mzweerspenko+bugzilla at gmail.com
Cc mzweerspenko+bugzilla at gmail.com

Committed to 2018.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 2/2 package/ac: fix install

In reply to Yann E. MORIN

Do not overwrite destination file if it exists.

Simliar to bug #10986.

Cc mzweerspenko+bugzilla at gmail.com
---
 ...-all-use-install-1-to-install-executables.patch | 67 ++++++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 package/acl/0003-all-use-install-1-to-install-executables.patch
package/acl/0003-all-use-install-1-to-install-executables.patch new file +67 -0
new file mode 100644
index 0000000000..9640dd866d
@@ -0,0 +1,67 @@
+From d3bd7b29b79147b4155e78a8ea06ded98b91f92a Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <[email protected]>
+Date: Tue, 8 May 2018 15:23:57 +0200
+Subject: [PATCH] all: use install(1) to install executables
+
+When the destination file already exists, the current install script
+will overwrite it with the new executable.
+
+However, when the existing executable is a symlink or hardlink to
+something else, like busybox, this effectively overwrites that something
+with the new executable, and thus replaces busybox and all its applets
+with the code for either of the three commands.
+
+We fix that by simply calling install(1). install(1) is sufficiently
+widespread that we don't bother checking for it, as tis is just a
+workaround while waiting for the version bump that will eventually fix
+it for good.
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+---
+ chacl/Makefile   | 4 ++--
+ getfacl/Makefile | 4 ++--
+ setfacl/Makefile | 4 ++--
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/chacl/Makefile b/chacl/Makefile
+index 33858d6..c857329 100644
+--- a/chacl/Makefile
++++ b/chacl/Makefile
+@@ -30,6 +30,6 @@ default: $(LTCOMMAND)
+ include $(BUILDRULES)
+ 
+ install: default
+-	$(INSTALL) -m 755 -d $(PKG_BIN_DIR)
+-	$(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)
++	install -D -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)/$(LTCOMMAND)
++
+ install-dev install-lib:
+diff --git a/getfacl/Makefile b/getfacl/Makefile
+index 7fbafda..8ac63e0 100644
+--- a/getfacl/Makefile
++++ b/getfacl/Makefile
+@@ -31,6 +31,6 @@ default: $(LTCOMMAND)
+ include $(BUILDRULES)
+ 
+ install: default
+-	$(INSTALL) -m 755 -d $(PKG_BIN_DIR)
+-	$(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)
++	install -D -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)/$(LTCOMMAND)
++
+ install-dev install-lib:
+diff --git a/setfacl/Makefile b/setfacl/Makefile
+index c44e7c0..eea2ede 100644
+--- a/setfacl/Makefile
++++ b/setfacl/Makefile
+@@ -31,6 +31,6 @@ default: $(LTCOMMAND)
+ include $(BUILDRULES)
+ 
+ install: default
+-	$(INSTALL) -m 755 -d $(PKG_BIN_DIR)
+-	$(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)
++	install -D -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)/$(LTCOMMAND)
++
+ install-dev install-lib:
+-- 
+2.14.1
+
Signature · 1 line
2.14.1
#4 lore raw

PATCH 2/2 package/ac: fix install

Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Do not overwrite destination file if it exists.
Simliar to bug #10986.

Cc mzweerspenko+bugzilla at gmail.com

Committed to 2018.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

cover package/attr,acl: fix installation

In reply to Yann E. MORIN

Hello,

Quoted 3 lines · Yann E. MORIN

Yann E. MORIN (2):
package/attr: fix install
package/ac: fix install

Both applied, thanks. For the second patch, I fixed the typo in the commit title. Thanks for having worked on a temporary workaround suitable for master.

Could you mark the corresponding bug as fixed in our bug tracker ?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com