/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Teddy Hogeborn
  • Date: 2008-09-05 23:39:07 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080905233907-3rz7kuwyjwma0pjx
* Makefile (confdir/clients.conf): Tighten permissions to "u=rw".
  (install-server): Set mode of "/etc/mandos/clients.conf" to
                             "u=rw".
  (install-client): Set mode of "/etc/mandos/plugins.d" to "u=rwx".
  (uninstall-client): Also remove "/usr/lib/mandos/plugins.d/usplash",
                "/usr/share/initramfs-tools/scripts/local-top/mandos",
                      and "/etc/keys/mandos".
  (purge-server): Also remove "/var/run/mandos.pid".

* initramfs-tools-hook: Use "install" instead of "mkdir".  Change
                        owner of "/lib/mandos/plugins.d" and key
                        files.  Bug fix: do not repair permissions of
                        "/lib/mandos/plugins.d".  Bug fix: Really
                        avoid deliberately unreadable files and/or
                        directories.

* mandos-keygen (umask): Changed to "077".

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
KEYDIR=$(DESTDIR)/etc/keys/mandos
22
22
# MANDIR=/usr/local/man
23
23
MANDIR=$(DESTDIR)/usr/share/man
24
 
PIDDIR=/var/run/mandos
25
 
USER=nobody
26
 
GROUP=nogroup
27
24
 
28
25
GNUTLS_CFLAGS=$(shell libgnutls-config --cflags)
29
26
GNUTLS_LIBS=$(shell libgnutls-config --libs)
129
126
        install --mode=u=rw,go=r $^ $@
130
127
confdir/clients.conf: clients.conf keydir/seckey.txt
131
128
        install --directory confdir
132
 
        install --mode=u=rw,g=r $< $@
 
129
        install --mode=u=rw $< $@
133
130
# Add a client password
134
131
        ./mandos-keygen --dir keydir --password >> $@
135
132
 
138
135
install-server: doc
139
136
        install --directory $(CONFDIR) $(MANDIR)/man5 \
140
137
                $(MANDIR)/man8
141
 
        install --mode=u=rwx,go=rx --owner=$(USER) --group=$(GROUP) \
142
 
                --directory $(PIDDIR)
143
138
        install --mode=u=rwx,go=rx mandos $(PREFIX)/sbin/mandos
144
139
        install --mode=u=rw,go=r --target-directory=$(CONFDIR) \
145
140
                mandos.conf
146
 
        install --mode=u=rw,g=r --target-directory=$(CONFDIR) \
 
141
        install --mode=u=rw --target-directory=$(CONFDIR) \
147
142
                clients.conf
148
143
        install --mode=u=rwx,go=rx init.d-mandos /etc/init.d/mandos
149
144
        install --mode=u=rw,go=r default-mandos /etc/default/mandos
163
158
                $(PREFIX)/lib/mandos/plugins.d
164
159
        if [ "$(CONFDIR)/plugins.d" \
165
160
                        != "$(PREFIX)/lib/mandos/plugins.d" ]; then \
166
 
                        install --directory "$(CONFDIR)/plugins.d"; \
167
 
                fi
 
161
                install --mode=u=rwx \
 
162
                        --directory "$(CONFDIR)/plugins.d"; \
 
163
        fi
168
164
        install --mode=u=rwx,go=rx \
169
165
                --target-directory=$(PREFIX)/lib/mandos plugin-runner
170
166
        install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
193
189
                > $(MANDIR)/man8/password-prompt.8mandos.gz
194
190
        gzip --best --to-stdout plugins.d/password-request.8mandos \
195
191
                > $(MANDIR)/man8/password-request.8mandos.gz
 
192
# Post-installation stuff
196
193
        -$(PREFIX)/sbin/mandos-keygen --dir "$(KEYDIR)"
197
194
        update-initramfs -k all -u
198
195
        echo "Now run mandos-keygen --password --dir $(KEYDIR)"
205
202
                $(MANDIR)/man5/mandos.conf.5.gz \
206
203
                $(MANDIR)/man5/mandos-clients.conf.5.gz
207
204
        update-rc.d -f mandos remove
208
 
        -rmdir $(CONFDIR) $(PIDDIR)
 
205
        -rmdir $(CONFDIR)
209
206
 
210
207
uninstall-client:
211
208
# Refuse to uninstall client if /etc/crypttab is explicitly configured
216
213
                $(PREFIX)/lib/mandos/plugin-runner \
217
214
                $(PREFIX)/lib/mandos/plugins.d/password-prompt \
218
215
                $(PREFIX)/lib/mandos/plugins.d/password-request \
 
216
                $(PREFIX)/lib/mandos/plugins.d/usplash \
219
217
                /usr/share/initramfs-tools/hooks/mandos \
220
218
                /usr/share/initramfs-tools/conf-hooks.d/mandos \
 
219
                /usr/share/initramfs-tools/scripts/local-top/mandos \
221
220
                $(MANDIR)/man8/plugin-runner.8mandos.gz \
222
221
                $(MANDIR)/man8/mandos-keygen.8.gz \
223
222
                $(MANDIR)/man8/password-prompt.8mandos.gz \
224
223
                $(MANDIR)/man8/password-request.8mandos.gz
225
224
        -rmdir $(PREFIX)/lib/mandos/plugins.d $(CONFDIR)/plugins.d \
226
 
                 $(PREFIX)/lib/mandos $(CONFDIR)
 
225
                 $(PREFIX)/lib/mandos $(CONFDIR) $(KEYDIR)
227
226
        update-initramfs -k all -u
228
227
 
229
228
purge: purge-server purge-client
230
229
 
231
230
purge-server: uninstall-server
232
231
        -rm --force $(CONFDIR)/mandos.conf $(CONFDIR)/clients.conf \
233
 
                /etc/default/mandos /etc/init.d/mandos
 
232
                /etc/default/mandos /etc/init.d/mandos \
 
233
                /var/run/mandos.pid
234
234
        -rmdir $(CONFDIR)
235
235
 
236
236
purge-client: uninstall-client