Blame SOURCES/0024-build-drop-install-o-g-root.patch

05e71a
From 2dcebe667a4cbebe0c825633510c015143d5ed92 Mon Sep 17 00:00:00 2001
05e71a
From: Jan Engelhardt <jengelh@inai.de>
05e71a
Date: Wed, 27 Jun 2018 11:50:38 +0200
05e71a
Subject: [PATCH] build: drop install -o/-g root
05e71a
05e71a
Calling /usr/bin/install with -o/-g will attempt to chown, and fail
05e71a
if unsuccessful, which makes an unprivileged install with DESTDIR a
05e71a
futile attempt always.
05e71a
05e71a
Drop it, because /usr/bin/install chowns to the current running user
05e71a
*anyway*, which means when root calls `make install`, it will do the
05e71a
right thing as before.
05e71a
05e71a
Signed-off-by: Florian Westphal <fw@strlen.de>
05e71a
Signed-off-by: Phil Sutter <psutter@redhat.com>
05e71a
---
05e71a
 Makefile | 24 ++++++++++++------------
05e71a
 1 file changed, 12 insertions(+), 12 deletions(-)
05e71a
05e71a
diff --git a/Makefile b/Makefile
05e71a
index c1106a4e08345..79ee167e0258b 100644
05e71a
--- a/Makefile
05e71a
+++ b/Makefile
05e71a
@@ -157,31 +157,31 @@ tmp3:=$(shell printf $(PIPE) | sed 's/\//\\\//g')
05e71a
 scripts: ebtables-save ebtables.sysv ebtables-config
05e71a
 	cat ebtables-save | sed 's/__EXEC_PATH__/$(tmp1)/g' > ebtables-save_
05e71a
 	mkdir -p $(DESTDIR)$(BINDIR)
05e71a
-	install -m 0755 -o root -g root ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save
05e71a
+	install -m 0755 ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save
05e71a
 	cat ebtables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables.sysv_
05e71a
 	if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(INITDIR); fi
05e71a
-	if test -d $(DESTDIR)$(INITDIR); then install -m 0755 -o root -g root ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables; fi
05e71a
+	if test -d $(DESTDIR)$(INITDIR); then install -m 0755 ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables; fi
05e71a
 	cat ebtables-config | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables-config_
05e71a
 	if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(SYSCONFIGDIR); fi
05e71a
-	if test -d $(DESTDIR)$(SYSCONFIGDIR); then install -m 0600 -o root -g root ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config; fi
05e71a
+	if test -d $(DESTDIR)$(SYSCONFIGDIR); then install -m 0600 ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config; fi
05e71a
 	rm -f ebtables-save_ ebtables.sysv_ ebtables-config_
05e71a
 
05e71a
 tmp4:=$(shell printf $(LOCKFILE) | sed 's/\//\\\//g')
05e71a
 $(MANDIR)/man8/ebtables.8: ebtables.8
05e71a
 	mkdir -p $(DESTDIR)$(@D)
05e71a
 	sed -e 's/$$(VERSION)/$(PROGVERSION)/' -e 's/$$(DATE)/$(PROGDATE)/' -e 's/$$(LOCKFILE)/$(tmp4)/' ebtables.8 > ebtables.8_
05e71a
-	install -m 0644 -o root -g root ebtables.8_ $(DESTDIR)$@
05e71a
+	install -m 0644 ebtables.8_ $(DESTDIR)$@
05e71a
 	rm -f ebtables.8_
05e71a
 
05e71a
 $(DESTDIR)$(ETHERTYPESFILE): ethertypes
05e71a
 	mkdir -p $(@D)
05e71a
-	install -m 0644 -o root -g root $< $@
05e71a
+	install -m 0644 $< $@
05e71a
 
05e71a
 .PHONY: exec
05e71a
 exec: ebtables ebtables-restore
05e71a
 	mkdir -p $(DESTDIR)$(BINDIR)
05e71a
-	install -m 0755 -o root -g root $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME)
05e71a
-	install -m 0755 -o root -g root ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore
05e71a
+	install -m 0755 $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME)
05e71a
+	install -m 0755 ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore
05e71a
 
05e71a
 .PHONY: install
05e71a
 install: $(MANDIR)/man8/ebtables.8 $(DESTDIR)$(ETHERTYPESFILE) exec scripts
05e71a
@@ -205,18 +205,18 @@ release:
05e71a
 	rm -f extensions/ebt_inat.c
05e71a
 	rm -rf $(CVSDIRS)
05e71a
 	mkdir -p include/linux/netfilter_bridge
05e71a
-	install -m 0644 -o root -g root \
05e71a
+	install -m 0644 \
05e71a
 		$(KERNEL_INCLUDES)/linux/netfilter_bridge.h include/linux/
05e71a
 # To keep possible compile error complaints about undefined ETH_P_8021Q
05e71a
 # off my back
05e71a
-	install -m 0644 -o root -g root \
05e71a
+	install -m 0644 \
05e71a
 		$(KERNEL_INCLUDES)/linux/if_ether.h include/linux/
05e71a
-	install -m 0644 -o root -g root \
05e71a
+	install -m 0644 \
05e71a
 		$(KERNEL_INCLUDES)/linux/types.h include/linux/
05e71a
-	install -m 0644 -o root -g root \
05e71a
+	install -m 0644 \
05e71a
 		$(KERNEL_INCLUDES)/linux/netfilter_bridge/*.h \
05e71a
 		include/linux/netfilter_bridge/
05e71a
-	install -m 0644 -o root -g root \
05e71a
+	install -m 0644 \
05e71a
 		include/ebtables.h include/linux/netfilter_bridge/
05e71a
 	make clean
05e71a
 	touch *
05e71a
-- 
05e71a
2.21.0
05e71a