imagemagick: bump version to 7.0.4-3 (security)
[buildroot-gz.git] / package / cups / 0003-Sanitize-the-installation-process.patch
blob25bfa42a30648f256741ac38b1a5e3431c93cefb
1 From e35f809c435c224954a5c7bff3f5729c5b3bc0ba Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Thu, 21 Jan 2016 23:21:06 +0100
4 Subject: [PATCH] Sanitize the installation process
6 The installation process does two things that are not convenient when
7 cross-compiling:
9 - It uses install's -s option to strip binaries, but this option uses
10 the host strip and not the cross strip, which fails at stripping
11 binaries. In addition, we do not necessarily want cups to strip its
12 binaries, we may want to keep the debugging symbols.
14 - It enforces ownership (user, group) which isn't possible since
15 "make install" isn't executed as root when cross-compiling.
17 - It installs many files and directories with permissions that
18 prevent overwriting those files/directories, which meant calling
19 "make install" twice was failing.
21 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
22 ---
23 Makedefs.in | 12 ++++++------
24 conf/Makefile | 6 +++---
25 notifier/Makefile | 2 +-
26 scheduler/Makefile | 17 ++++++++---------
27 4 files changed, 18 insertions(+), 19 deletions(-)
29 diff --git a/Makedefs.in b/Makedefs.in
30 index 3afef0a..3e4f1bd 100644
31 --- a/Makedefs.in
32 +++ b/Makedefs.in
33 @@ -40,14 +40,14 @@ SHELL = /bin/sh
34 # Installation programs...
37 -INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
38 -INSTALL_COMPDATA = $(INSTALL) -c -m 444 @INSTALL_GZIP@
39 +INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 755
40 +INSTALL_COMPDATA = $(INSTALL) -c -m 644 @INSTALL_GZIP@
41 INSTALL_CONFIG = $(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@
42 -INSTALL_DATA = $(INSTALL) -c -m 444
43 +INSTALL_DATA = $(INSTALL) -c -m 644
44 INSTALL_DIR = $(INSTALL) -d
45 -INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
46 -INSTALL_MAN = $(INSTALL) -c -m 444
47 -INSTALL_SCRIPT = $(INSTALL) -c -m 555
48 +INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 755
49 +INSTALL_MAN = $(INSTALL) -c -m 644
50 +INSTALL_SCRIPT = $(INSTALL) -c -m 755
53 # Default user, group, and system groups for the scheduler...
54 diff --git a/conf/Makefile b/conf/Makefile
55 index 933d7d9..6ac5e19 100644
56 --- a/conf/Makefile
57 +++ b/conf/Makefile
58 @@ -72,11 +72,11 @@ install: all install-data install-headers install-libs install-exec
59 install-data:
60 for file in $(KEEP); do \
61 if test -r $(SERVERROOT)/$$file ; then \
62 - $(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT)/$$file.N ; \
63 + $(INSTALL_CONFIG) $$file $(SERVERROOT)/$$file.N ; \
64 else \
65 - $(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT) ; \
66 + $(INSTALL_CONFIG) $$file $(SERVERROOT) ; \
67 fi ; \
68 - $(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT)/$$file.default; \
69 + $(INSTALL_CONFIG) $$file $(SERVERROOT)/$$file.default; \
70 done
71 $(INSTALL_DIR) -m 755 $(DATADIR)/mime
72 for file in $(REPLACE); do \
73 diff --git a/notifier/Makefile b/notifier/Makefile
74 index 3206dd0..c34a4d7 100644
75 --- a/notifier/Makefile
76 +++ b/notifier/Makefile
77 @@ -62,7 +62,7 @@ install: all install-data install-headers install-libs install-exec
80 install-data:
81 - $(INSTALL_DIR) -m 775 -g $(CUPS_GROUP) $(CACHEDIR)/rss
82 + $(INSTALL_DIR) -m 775 $(CACHEDIR)/rss
86 diff --git a/scheduler/Makefile b/scheduler/Makefile
87 index c7d244d..a96a528 100644
88 --- a/scheduler/Makefile
89 +++ b/scheduler/Makefile
90 @@ -148,30 +148,29 @@ install-data:
91 echo Creating $(SERVERBIN)/driver...
92 $(INSTALL_DIR) -m 755 $(SERVERBIN)/driver
93 echo Creating $(SERVERROOT)...
94 - $(INSTALL_DIR) -m 755 -g $(CUPS_GROUP) $(SERVERROOT)
95 + $(INSTALL_DIR) -m 755 $(SERVERROOT)
96 echo Creating $(SERVERROOT)/interfaces...
97 - $(INSTALL_DIR) -m 755 -g $(CUPS_GROUP) $(SERVERROOT)/interfaces
98 + $(INSTALL_DIR) -m 755 $(SERVERROOT)/interfaces
99 echo Creating $(SERVERROOT)/ppd...
100 - $(INSTALL_DIR) -m 755 -g $(CUPS_GROUP) $(SERVERROOT)/ppd
101 + $(INSTALL_DIR) -m 755 $(SERVERROOT)/ppd
102 if test "x`uname`" != xDarwin; then \
103 echo Creating $(SERVERROOT)/ssl...; \
104 - $(INSTALL_DIR) -m 700 -g $(CUPS_GROUP) $(SERVERROOT)/ssl; \
105 + $(INSTALL_DIR) -m 700 $(SERVERROOT)/ssl; \
107 if test "$(STATEDIR)" != "$(SERVERROOT)"; then \
108 echo Creating $(STATEDIR)...; \
109 $(INSTALL_DIR) -m 755 $(STATEDIR); \
111 echo Creating $(STATEDIR)/certs...
112 - $(INSTALL_DIR) -m 511 -o $(CUPS_USER) -g $(CUPS_PRIMARY_SYSTEM_GROUP) \
113 - $(STATEDIR)/certs
114 + $(INSTALL_DIR) -m 711 $(STATEDIR)/certs
115 echo Creating $(LOGDIR)...
116 $(INSTALL_DIR) -m 755 $(LOGDIR)
117 echo Creating $(REQUESTS)...
118 - $(INSTALL_DIR) -m 710 -g $(CUPS_GROUP) $(REQUESTS)
119 + $(INSTALL_DIR) -m 710 $(REQUESTS)
120 echo Creating $(REQUESTS)/tmp...
121 - $(INSTALL_DIR) -m 1770 -g $(CUPS_GROUP) $(REQUESTS)/tmp
122 + $(INSTALL_DIR) -m 1770 $(REQUESTS)/tmp
123 echo Creating $(CACHEDIR)...
124 - $(INSTALL_DIR) -m 770 -g $(CUPS_GROUP) $(CACHEDIR)
125 + $(INSTALL_DIR) -m 770 $(CACHEDIR)
126 if test "x$(INITDIR)" != x; then \
127 echo Installing init scripts...; \
128 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \
130 2.6.4