Blob Blame History Raw
From 2dcebe667a4cbebe0c825633510c015143d5ed92 Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@inai.de>
Date: Wed, 27 Jun 2018 11:50:38 +0200
Subject: [PATCH] build: drop install -o/-g root

Calling /usr/bin/install with -o/-g will attempt to chown, and fail
if unsuccessful, which makes an unprivileged install with DESTDIR a
futile attempt always.

Drop it, because /usr/bin/install chowns to the current running user
*anyway*, which means when root calls `make install`, it will do the
right thing as before.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Phil Sutter <psutter@redhat.com>
---
 Makefile | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile
index c1106a4e08345..79ee167e0258b 100644
--- a/Makefile
+++ b/Makefile
@@ -157,31 +157,31 @@ tmp3:=$(shell printf $(PIPE) | sed 's/\//\\\//g')
 scripts: ebtables-save ebtables.sysv ebtables-config
 	cat ebtables-save | sed 's/__EXEC_PATH__/$(tmp1)/g' > ebtables-save_
 	mkdir -p $(DESTDIR)$(BINDIR)
-	install -m 0755 -o root -g root ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save
+	install -m 0755 ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save
 	cat ebtables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables.sysv_
 	if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(INITDIR); fi
-	if test -d $(DESTDIR)$(INITDIR); then install -m 0755 -o root -g root ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables; fi
+	if test -d $(DESTDIR)$(INITDIR); then install -m 0755 ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables; fi
 	cat ebtables-config | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables-config_
 	if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(SYSCONFIGDIR); fi
-	if test -d $(DESTDIR)$(SYSCONFIGDIR); then install -m 0600 -o root -g root ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config; fi
+	if test -d $(DESTDIR)$(SYSCONFIGDIR); then install -m 0600 ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config; fi
 	rm -f ebtables-save_ ebtables.sysv_ ebtables-config_
 
 tmp4:=$(shell printf $(LOCKFILE) | sed 's/\//\\\//g')
 $(MANDIR)/man8/ebtables.8: ebtables.8
 	mkdir -p $(DESTDIR)$(@D)
 	sed -e 's/$$(VERSION)/$(PROGVERSION)/' -e 's/$$(DATE)/$(PROGDATE)/' -e 's/$$(LOCKFILE)/$(tmp4)/' ebtables.8 > ebtables.8_
-	install -m 0644 -o root -g root ebtables.8_ $(DESTDIR)$@
+	install -m 0644 ebtables.8_ $(DESTDIR)$@
 	rm -f ebtables.8_
 
 $(DESTDIR)$(ETHERTYPESFILE): ethertypes
 	mkdir -p $(@D)
-	install -m 0644 -o root -g root $< $@
+	install -m 0644 $< $@
 
 .PHONY: exec
 exec: ebtables ebtables-restore
 	mkdir -p $(DESTDIR)$(BINDIR)
-	install -m 0755 -o root -g root $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME)
-	install -m 0755 -o root -g root ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore
+	install -m 0755 $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME)
+	install -m 0755 ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore
 
 .PHONY: install
 install: $(MANDIR)/man8/ebtables.8 $(DESTDIR)$(ETHERTYPESFILE) exec scripts
@@ -205,18 +205,18 @@ release:
 	rm -f extensions/ebt_inat.c
 	rm -rf $(CVSDIRS)
 	mkdir -p include/linux/netfilter_bridge
-	install -m 0644 -o root -g root \
+	install -m 0644 \
 		$(KERNEL_INCLUDES)/linux/netfilter_bridge.h include/linux/
 # To keep possible compile error complaints about undefined ETH_P_8021Q
 # off my back
-	install -m 0644 -o root -g root \
+	install -m 0644 \
 		$(KERNEL_INCLUDES)/linux/if_ether.h include/linux/
-	install -m 0644 -o root -g root \
+	install -m 0644 \
 		$(KERNEL_INCLUDES)/linux/types.h include/linux/
-	install -m 0644 -o root -g root \
+	install -m 0644 \
 		$(KERNEL_INCLUDES)/linux/netfilter_bridge/*.h \
 		include/linux/netfilter_bridge/
-	install -m 0644 -o root -g root \
+	install -m 0644 \
 		include/ebtables.h include/linux/netfilter_bridge/
 	make clean
 	touch *
-- 
2.21.0