/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
1
WARN=-O -Wall -Wformat=2 -Winit-self -Wmissing-include-dirs \
2
	-Wswitch-default -Wswitch-enum -Wunused-parameter \
3
	-Wstrict-aliasing=2 -Wextra -Wfloat-equal -Wundef -Wshadow \
4
	-Wunsafe-loop-optimizations -Wpointer-arith \
5
	-Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings \
6
	-Wconversion -Wstrict-prototypes -Wold-style-definition \
7
	-Wpacked -Wnested-externs -Wunreachable-code -Winline \
8
	-Wvolatile-register-var
21 by Teddy Hogeborn
* Makefile (CFLAGS): Changed to use $(WARN), $(DEBUG), $(COVERAGE) and
9
DEBUG=-ggdb3
28 by Teddy Hogeborn
* server.conf: New file.
10
# For info about _FORTIFY_SOURCE, see
11
# <http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html>
12
FORTIFY=-D_FORTIFY_SOURCE=2 # -fstack-protector-all
73 by Teddy Hogeborn
* Makefile (COVERAGE): Change back to "--coverage".
13
#COVERAGE=--coverage
24.1.51 by Björn Påhlsson
Added configuration files support for mandos-client
14
OPTIMIZE=-Os
21 by Teddy Hogeborn
* Makefile (CFLAGS): Changed to use $(WARN), $(DEBUG), $(COVERAGE) and
15
LANGUAGE=-std=gnu99
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
16
# PREFIX=/usr/local
17
PREFIX=/usr
18
# CONFDIR=/usr/local/lib/mandos
19
CONFDIR=/etc/mandos
20
# MANDIR=/usr/local/man
21
MANDIR=/usr/share/man
21 by Teddy Hogeborn
* Makefile (CFLAGS): Changed to use $(WARN), $(DEBUG), $(COVERAGE) and
22
81 by Teddy Hogeborn
* Makefile (GNUTLS_CFLAGS, GNUTLS_LIBS, AVAHI_CFLAGS, AVAHI_LIBS,
23
GNUTLS_CFLAGS=$(shell libgnutls-config --cflags)
24
GNUTLS_LIBS=$(shell libgnutls-config --libs)
25
AVAHI_CFLAGS=$(shell pkg-config --cflags-only-I avahi-core)
26
AVAHI_LIBS=$(shell pkg-config --libs avahi-core)
27
GPGME_CFLAGS=$(shell gpgme-config --cflags)
28
GPGME_LIBS=$(shell gpgme-config --libs)
29
21 by Teddy Hogeborn
* Makefile (CFLAGS): Changed to use $(WARN), $(DEBUG), $(COVERAGE) and
30
# Do not change these two
81 by Teddy Hogeborn
* Makefile (GNUTLS_CFLAGS, GNUTLS_LIBS, AVAHI_CFLAGS, AVAHI_LIBS,
31
CFLAGS=$(WARN) $(DEBUG) $(FORTIFY) $(COVERAGE) $(OPTIMIZE) \
32
	$(LANGUAGE) $(GNUTLS_CFLAGS) $(AVAHI_CFLAGS) $(GPGME_CFLAGS)
21 by Teddy Hogeborn
* Makefile (CFLAGS): Changed to use $(WARN), $(DEBUG), $(COVERAGE) and
33
LDFLAGS=$(COVERAGE)
16 by Teddy Hogeborn
* Makefile: Include targets for all binaries.
34
62 by Teddy Hogeborn
* Makefile (DOCBOOKTOMAN): Do not generate AUTHORS section.
35
DOCBOOKTOMAN=xsltproc --nonet \
36
	--param man.charmap.use.subset		0 \
37
	--param make.year.ranges		1 \
38
	--param make.single.year.ranges		1 \
39
	--param man.output.quietly		1 \
40
	--param man.authors.section.enabled	0
81 by Teddy Hogeborn
* Makefile (GNUTLS_CFLAGS, GNUTLS_LIBS, AVAHI_CFLAGS, AVAHI_LIBS,
41
# DocBook-to-man post-processing to fix a \n escape bug
42
MANPOST=sed --in-place --expression='s,\\en,\en,g;s,\een,\en,g'
24.1.25 by Björn Påhlsson
* clients.conf.xml: Renamed to "mandos-clients.conf.xml".
43
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
44
PLUGINS=plugins.d/password-prompt plugins.d/password-request
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
45
PROGS=plugin-runner $(PLUGINS)
46
DOCS=mandos.8 plugin-runner.8mandos mandos-keygen.8 \
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
47
	plugins.d/password-request.8mandos \
48
	plugins.d/password-prompt.8mandos mandos.conf.5 \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
49
	mandos-clients.conf.5
16 by Teddy Hogeborn
* Makefile: Include targets for all binaries.
50
81 by Teddy Hogeborn
* Makefile (GNUTLS_CFLAGS, GNUTLS_LIBS, AVAHI_CFLAGS, AVAHI_LIBS,
51
objects=$(addsuffix .o,$(PROGS))
16 by Teddy Hogeborn
* Makefile: Include targets for all binaries.
52
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
53
all: $(PROGS)
54
55
doc: $(DOCS)
24.1.25 by Björn Påhlsson
* clients.conf.xml: Renamed to "mandos-clients.conf.xml".
56
57
%.5: %.xml
81 by Teddy Hogeborn
* Makefile (GNUTLS_CFLAGS, GNUTLS_LIBS, AVAHI_CFLAGS, AVAHI_LIBS,
58
	cd $(dir $^); $(DOCBOOKTOMAN) $(notdir $^) $(MANPOST) $@
24.1.25 by Björn Påhlsson
* clients.conf.xml: Renamed to "mandos-clients.conf.xml".
59
60
%.8: %.xml
81 by Teddy Hogeborn
* Makefile (GNUTLS_CFLAGS, GNUTLS_LIBS, AVAHI_CFLAGS, AVAHI_LIBS,
61
	cd $(dir $^); $(DOCBOOKTOMAN) $(notdir $^); $(MANPOST) $@
24.1.25 by Björn Påhlsson
* clients.conf.xml: Renamed to "mandos-clients.conf.xml".
62
63
%.8mandos: %.xml
81 by Teddy Hogeborn
* Makefile (GNUTLS_CFLAGS, GNUTLS_LIBS, AVAHI_CFLAGS, AVAHI_LIBS,
64
	cd $(dir $^); $(DOCBOOKTOMAN) $(notdir $^) $(MANPOST) $@
16 by Teddy Hogeborn
* Makefile: Include targets for all binaries.
65
47 by Teddy Hogeborn
* plugbasedclient.c: Renamed to "mandos-client.c". All users changed.
66
plugins.d/password-request: plugins.d/password-request.o
81 by Teddy Hogeborn
* Makefile (GNUTLS_CFLAGS, GNUTLS_LIBS, AVAHI_CFLAGS, AVAHI_LIBS,
67
	$(LINK.o) $(GNUTLS_LIBS) $(AVAHI_LIBS) $(GPGME_LIBS) \
68
		$(COMMON) $^ $(LOADLIBES) $(LDLIBS) -o $@
69
70
.PHONY : all doc clean distclean run-client run-server install \
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
71
	install-server install-client uninstall uninstall-server \
72
	uninstall-client purge purge-server purge-client
47 by Teddy Hogeborn
* plugbasedclient.c: Renamed to "mandos-client.c". All users changed.
73
1 by Björn Påhlsson
First working version with: IPv6, GnuTLS, X.509 certificates, DN
74
clean:
24.1.25 by Björn Påhlsson
* clients.conf.xml: Renamed to "mandos-clients.conf.xml".
75
	-rm --force $(PROGS) $(objects) $(DOCS) core
47 by Teddy Hogeborn
* plugbasedclient.c: Renamed to "mandos-client.c". All users changed.
76
77
distclean: clean
78
mostlyclean: clean
79
maintainer-clean: clean
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
80
	-rm --force --recursive keydir
47 by Teddy Hogeborn
* plugbasedclient.c: Renamed to "mandos-client.c". All users changed.
81
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
82
check:
47 by Teddy Hogeborn
* plugbasedclient.c: Renamed to "mandos-client.c". All users changed.
83
	./mandos --check
84
85
run-client: all
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
86
	-mkdir keydir
87
	-./mandos-keygen --dir keydir
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
88
	./plugin-runner --plugin-dir=plugins.d \
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
89
		--options-for=password-request:--keydir=keydir
47 by Teddy Hogeborn
* plugbasedclient.c: Renamed to "mandos-client.c". All users changed.
90
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
91
run-server:
47 by Teddy Hogeborn
* plugbasedclient.c: Renamed to "mandos-client.c". All users changed.
92
	./mandos --debug --configdir=.
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
93
94
install: install-server install-client
95
96
install-server: doc
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
97
	mkdir --mode=0755 --parents $(CONFDIR) $(MANDIR)/man5 \
98
		$(MANDIR)/man8
99
	install --mode=0755 mandos $(PREFIX)/sbin/mandos
100
	install --mode=0644 --target-directory=$(CONFDIR) mandos.conf
101
	install --mode=0640 --target-directory=$(CONFDIR) \
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
102
		clients.conf
103
	gzip --best --to-stdout mandos.8 \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
104
		> $(MANDIR)/man8/mandos.8.gz
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
105
	gzip --best --to-stdout mandos.conf.5 \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
106
		> $(MANDIR)/man5/mandos.conf.5.gz
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
107
	gzip --best --to-stdout mandos-clients.conf.5 \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
108
		> $(MANDIR)/man5/mandos-clients.conf.5.gz
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
109
110
install-client: all doc /usr/share/initramfs-tools/hooks/.
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
111
	mkdir --mode=0755 --parents $(PREFIX)/lib/mandos $(CONFDIR) \
112
		$(MANDIR)/man8
113
	-mkdir --mode=0700 $(PREFIX)/lib/mandos/plugins.d
114
	chmod u=rwx,g=,o= $(PREFIX)/lib/mandos/plugins.d
115
	install --mode=0755 --target-directory=$(PREFIX)/lib/mandos \
116
		plugin-runner
117
	install --mode=0755 --target-directory=$(PREFIX)/sbin \
118
		mandos-keygen
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
119
	install --mode=0755 \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
120
		--target-directory=$(PREFIX)/lib/mandos/plugins.d \
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
121
		plugins.d/password-prompt
122
	install --mode=4755 \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
123
		--target-directory=$(PREFIX)/lib/mandos/plugins.d \
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
124
		plugins.d/password-request
125
	install initramfs-tools-hook \
126
		/usr/share/initramfs-tools/hooks/mandos
127
	install initramfs-tools-hook-conf \
128
		/usr/share/initramfs-tools/conf-hooks.d/mandos
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
129
	install initramfs-tools-script \
130
		/usr/share/initramfs-tools/scripts/local-top/mandos
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
131
	gzip --best --to-stdout mandos-keygen.8 \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
132
		> $(MANDIR)/man8/mandos-keygen.8.gz
133
	gzip --best --to-stdout plugin-runner.8mandos \
134
		> $(MANDIR)/man8/plugin-runner.8mandos.gz
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
135
	gzip --best --to-stdout plugins.d/password-prompt.8mandos \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
136
		> $(MANDIR)/man8/password-prompt.8mandos.gz
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
137
	gzip --best --to-stdout plugins.d/password-request.8mandos \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
138
		> $(MANDIR)/man8/password-request.8mandos.gz
139
	-$(PREFIX)/sbin/mandos-keygen
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
140
	update-initramfs -k all -u
141
142
uninstall: uninstall-server uninstall-client
143
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
144
uninstall-server: $(PREFIX)/sbin/mandos
145
	-rm --force $(PREFIX)/sbin/mandos \
146
		$(MANDIR)/man8/mandos.8.gz \
147
		$(MANDIR)/man5/mandos.conf.5.gz \
148
		$(MANDIR)/man5/mandos-clients.conf.5.gz
149
	-rmdir $(CONFDIR)
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
150
151
uninstall-client:
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
152
# Refuse to uninstall client if /etc/crypttab is explicitly configured
153
# to use it.
154
	! grep --regexp='^ *[^ #].*keyscript=[^,=]*/mandos/' \
72 by Teddy Hogeborn
* Makefile (uninstall-client): Refuse to uninstall if it is in use.
155
		/etc/crypttab
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
156
	-rm --force $(PREFIX)/sbin/mandos-keygen \
157
		$(PREFIX)/lib/mandos/plugin-runner \
158
		$(PREFIX)/lib/mandos/plugins.d/password-prompt \
159
		$(PREFIX)/lib/mandos/plugins.d/password-request \
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
160
		/usr/share/initramfs-tools/hooks/mandos \
161
		/usr/share/initramfs-tools/conf-hooks.d/mandos \
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
162
		$(MANDIR)/man8/plugin-runner.8mandos.gz \
163
		$(MANDIR)/man8/mandos-keygen.8.gz \
164
		$(MANDIR)/man8/password-prompt.8mandos.gz \
165
		$(MANDIR)/man8/password-request.8mandos.gz
166
	-rmdir $(PREFIX)/lib/mandos/plugins.d $(CONFDIR)/plugins.d \
167
		 $(PREFIX)/lib/mandos $(CONFDIR)
168
	update-initramfs -k all -u
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
169
170
purge: purge-server purge-client
171
172
purge-server: uninstall-server
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
173
	-rm --force $(CONFDIR)/mandos.conf $(CONFDIR)/clients.conf
174
	-rmdir $(CONFDIR)
67 by Teddy Hogeborn
* mandos-keygen: New program to generate new client keys on
175
176
purge-client: uninstall-client
74 by Teddy Hogeborn
* Makefile (PREFIX, CONFDIR): New.
177
	-rm --force $(CONFDIR)/seckey.txt $(CONFDIR)/pubkey.txt
178
	-rmdir $(CONFDIR) $(CONFDIR)/plugins.d