1 |
The default owner is root:root anyway, so just make sure other settings do not |
2 |
leak outside from the places where it is actually used. Use more appropiate |
3 |
install helpers at several places. This also fixes qmail_supervise_install_one() |
4 |
when called from outside of qmail_src_install(). |
5 |
|
6 |
Signed-off-by: Rolf Eike Beer <eike@×××××××.de> |
7 |
--- |
8 |
eclass/qmail.eclass | 87 ++++++++++++++++++++++----------------------- |
9 |
1 file changed, 42 insertions(+), 45 deletions(-) |
10 |
|
11 |
diff --git a/eclass/qmail.eclass b/eclass/qmail.eclass |
12 |
index 6b04cbf7792..be31dccc101 100644 |
13 |
--- a/eclass/qmail.eclass |
14 |
+++ b/eclass/qmail.eclass |
15 |
@@ -72,9 +72,8 @@ is_prime() { |
16 |
} |
17 |
|
18 |
dospp() { |
19 |
- insinto "${QMAIL_HOME}"/plugins/ |
20 |
- insopts -o root -g "${GROUP_ROOT}" -m 0755 |
21 |
- newins $1 ${2:-$(basename $1)} |
22 |
+ exeinto "${QMAIL_HOME}"/plugins/ |
23 |
+ newexe ${1} ${2:-$(basename ${1})} |
24 |
} |
25 |
|
26 |
# @FUNCTION: dosupervise |
27 |
@@ -86,17 +85,14 @@ dosupervise() { |
28 |
local runfile=${2:-${service}} logfile=${3:-${service}-log} |
29 |
[[ -z "${service}" ]] && die "no service given" |
30 |
|
31 |
- insopts -o root -g "${GROUP_ROOT}" -m 0755 |
32 |
- diropts -o root -g "${GROUP_ROOT}" -m 0755 |
33 |
- |
34 |
dodir ${SUPERVISE_DIR}/${service}{,/log} |
35 |
fperms +t ${SUPERVISE_DIR}/${service}{,/log} |
36 |
|
37 |
- insinto ${SUPERVISE_DIR}/${service} |
38 |
- newins ${runfile} run |
39 |
+ exeinto ${SUPERVISE_DIR}/${service} |
40 |
+ newexe ${runfile} run |
41 |
|
42 |
- insinto ${SUPERVISE_DIR}/${service}/log |
43 |
- newins ${logfile} run |
44 |
+ exeinto ${SUPERVISE_DIR}/${service}/log |
45 |
+ newexe ${logfile} run |
46 |
} |
47 |
|
48 |
# @FUNCTION: qmail_set_cc |
49 |
@@ -149,41 +145,45 @@ qmail_spp_src_compile() { |
50 |
} |
51 |
|
52 |
qmail_base_install() { |
53 |
+ # subshell to not leak the install options |
54 |
+ ( |
55 |
einfo "Setting up basic directory hierarchy" |
56 |
- diropts -o root -g qmail -m 755 |
57 |
+ diropts -o root -g qmail |
58 |
keepdir "${QMAIL_HOME}"/{,bin,control} |
59 |
keepdir "${QMAIL_HOME}"/users |
60 |
- diropts -o alias -g qmail -m 755 |
61 |
+ diropts -o alias -g qmail |
62 |
keepdir "${QMAIL_HOME}"/alias |
63 |
|
64 |
einfo "Adding env.d entry for qmail" |
65 |
doenvd "${GENQMAIL_S}"/conf/99qmail |
66 |
|
67 |
einfo "Installing all qmail software" |
68 |
- insinto "${QMAIL_HOME}"/bin |
69 |
+ exeinto "${QMAIL_HOME}"/bin |
70 |
|
71 |
- insopts -o root -g qmail -m 755 |
72 |
- doins bouncesaying condredirect config-fast datemail except forward maildir2mbox \ |
73 |
+ exeopts -o root -g qmail |
74 |
+ doexe bouncesaying condredirect config-fast datemail except forward maildir2mbox \ |
75 |
maildirmake mailsubj predate preline qbiff \ |
76 |
qmail-{inject,qmqpc,qmqpd,qmtpd,qread,qstat,smtpd,tcpok,tcpto,showctl} \ |
77 |
qreceipt sendmail tcp-env |
78 |
|
79 |
# obsolete tools, install if they are still present |
80 |
for i in elq maildirwatch pinq qail qsmhook; do |
81 |
- [[ -x ${i} ]] && doins ${i} |
82 |
+ [[ -x ${i} ]] && doexe ${i} |
83 |
done |
84 |
|
85 |
- use pop3 && doins qmail-pop3d |
86 |
+ use pop3 && doexe qmail-pop3d |
87 |
|
88 |
- insopts -o root -g qmail -m 711 |
89 |
- doins qmail-{clean,getpw,local,pw2u,remote,rspawn,send} splogger |
90 |
- use pop3 && doins qmail-popup |
91 |
+ exeopts -o root -g qmail -m 711 |
92 |
+ doexe qmail-{clean,getpw,local,pw2u,remote,rspawn,send} splogger |
93 |
+ use pop3 && doexe qmail-popup |
94 |
|
95 |
- insopts -o root -g qmail -m 700 |
96 |
- doins qmail-{lspawn,newmrh,newu,start} |
97 |
+ exeopts -o root -g qmail -m 700 |
98 |
+ doexe qmail-{lspawn,newmrh,newu,start} |
99 |
|
100 |
- insopts -o qmailq -g qmail -m 4711 |
101 |
- doins qmail-queue |
102 |
+ exeopts -o qmailq -g qmail -m 4711 |
103 |
+ doexe qmail-queue |
104 |
+ |
105 |
+ ) |
106 |
|
107 |
declare -F qmail_base_install_hook >/dev/null && \ |
108 |
qmail_base_install_hook |
109 |
@@ -192,12 +192,10 @@ qmail_base_install() { |
110 |
qmail_config_install() { |
111 |
einfo "Installing stock configuration files" |
112 |
insinto "${QMAIL_HOME}"/control |
113 |
- insopts -o root -g "${GROUP_ROOT}" -m 644 |
114 |
doins "${GENQMAIL_S}"/control/{conf-*,defaultdelivery} |
115 |
|
116 |
einfo "Installing configuration sanity checker and launcher" |
117 |
insinto "${QMAIL_HOME}"/bin |
118 |
- insopts -o root -g "${GROUP_ROOT}" -m 644 |
119 |
doins "${GENQMAIL_S}"/control/qmail-config-system |
120 |
|
121 |
declare -F qmail_config_install_hook >/dev/null && \ |
122 |
@@ -224,7 +222,6 @@ qmail_man_install() { |
123 |
|
124 |
qmail_sendmail_install() { |
125 |
einfo "Installing sendmail replacement" |
126 |
- diropts -m 755 |
127 |
dodir /usr/sbin /usr/lib |
128 |
|
129 |
dosym "${QMAIL_HOME}"/bin/sendmail /usr/sbin/sendmail |
130 |
@@ -235,12 +232,21 @@ qmail_sendmail_install() { |
131 |
} |
132 |
|
133 |
qmail_maildir_install() { |
134 |
+ # subshell to not leak the install options |
135 |
+ ( |
136 |
# use the correct maildirmake |
137 |
# the courier-imap one has some extensions that are nicer |
138 |
MAILDIRMAKE="${D}${QMAIL_HOME}/bin/maildirmake" |
139 |
[[ -e /usr/bin/maildirmake ]] && \ |
140 |
MAILDIRMAKE="/usr/bin/maildirmake" |
141 |
|
142 |
+ einfo "Setting up default maildirs in the account skeleton" |
143 |
+ diropts -m 700 |
144 |
+ insinto /etc/skel |
145 |
+ newins "${GENQMAIL_S}"/control/defaultdelivery .qmail.example |
146 |
+ "${MAILDIRMAKE}" "${D}"/etc/skel/.maildir |
147 |
+ keepdir /etc/skel/.maildir/{cur,new,tmp} |
148 |
+ |
149 |
einfo "Setting up the default aliases" |
150 |
diropts -o alias -g qmail -m 700 |
151 |
"${MAILDIRMAKE}" "${D}${QMAIL_HOME}"/alias/.maildir |
152 |
@@ -253,13 +259,7 @@ qmail_maildir_install() { |
153 |
fi |
154 |
done |
155 |
|
156 |
- einfo "Setting up default maildirs in the account skeleton" |
157 |
- diropts -o root -g "${GROUP_ROOT}" -m 755 |
158 |
- insinto /etc/skel |
159 |
- insopts -o root -g "${GROUP_ROOT}" -m 644 |
160 |
- newins "${GENQMAIL_S}"/control/defaultdelivery .qmail.sample |
161 |
- "${MAILDIRMAKE}" "${D}"/etc/skel/.maildir |
162 |
- keepdir /etc/skel/.maildir/{cur,new,tmp} |
163 |
+ ) |
164 |
|
165 |
declare -F qmail_maildir_install_hook >/dev/null && \ |
166 |
qmail_maildir_install_hook |
167 |
@@ -268,7 +268,6 @@ qmail_maildir_install() { |
168 |
qmail_tcprules_install() { |
169 |
dodir "${TCPRULES_DIR}" |
170 |
insinto "${TCPRULES_DIR}" |
171 |
- insopts -o root -g "${GROUP_ROOT}" -m 0644 |
172 |
doins "${GENQMAIL_S}"/tcprules/Makefile.qmail |
173 |
doins "${GENQMAIL_S}"/tcprules/tcp.qmail-* |
174 |
use ssl && use pop3 || rm -f "${D}${TCPRULES_DIR}"/tcp.qmail-pop3sd |
175 |
@@ -276,8 +275,11 @@ qmail_tcprules_install() { |
176 |
|
177 |
qmail_supervise_install_one() { |
178 |
dosupervise ${1} |
179 |
- diropts -o qmaill -g "${GROUP_ROOT}" -m 755 |
180 |
+ # subshell to not leak the install options |
181 |
+ ( |
182 |
+ diropts -o qmaill -g root |
183 |
keepdir /var/log/qmail/${1} |
184 |
+ ) |
185 |
} |
186 |
|
187 |
qmail_supervise_install() { |
188 |
@@ -301,7 +303,6 @@ qmail_supervise_install() { |
189 |
qmail_spp_install() { |
190 |
einfo "Installing qmail-spp configuration files" |
191 |
insinto "${QMAIL_HOME}"/control/ |
192 |
- insopts -o root -g "${GROUP_ROOT}" -m 0644 |
193 |
doins "${GENQMAIL_S}"/spp/smtpplugins |
194 |
|
195 |
einfo "Installing qmail-spp plugins" |
196 |
@@ -321,17 +322,14 @@ qmail_ssl_install() { |
197 |
|
198 |
einfo "Installing SSL Certificate creation script" |
199 |
insinto "${QMAIL_HOME}"/control |
200 |
- insopts -o root -g "${GROUP_ROOT}" -m 0644 |
201 |
doins "${GENQMAIL_S}"/ssl/servercert.cnf |
202 |
|
203 |
- insinto "${QMAIL_HOME}"/bin |
204 |
- insopts -o root -g "${GROUP_ROOT}" -m 0755 |
205 |
- doins "${GENQMAIL_S}"/ssl/mkservercert |
206 |
+ exeinto "${QMAIL_HOME}"/bin |
207 |
+ doexe "${GENQMAIL_S}"/ssl/mkservercert |
208 |
|
209 |
einfo "Installing RSA key generation cronjob" |
210 |
- insinto /etc/${CRON_FOLDER} |
211 |
- insopts -o root -g "${GROUP_ROOT}" -m 0755 |
212 |
- doins "${GENQMAIL_S}"/ssl/qmail-genrsacert.sh |
213 |
+ exeinto /etc/${CRON_FOLDER} |
214 |
+ doexe "${GENQMAIL_S}"/ssl/qmail-genrsacert.sh |
215 |
|
216 |
keepdir "${QMAIL_HOME}"/control/tlshosts |
217 |
|
218 |
@@ -340,7 +338,6 @@ qmail_ssl_install() { |
219 |
} |
220 |
|
221 |
qmail_src_install() { |
222 |
- export GROUP_ROOT="$(id -gn root)" |
223 |
qmail_base_install |
224 |
qmail_config_install |
225 |
qmail_man_install |
226 |
-- |
227 |
2.26.2 |