Skip to content

Commit f25c972

Browse files
committed
Add Cancel-Lock support in nnrpd and a secrets file
Implement Cancel-Lock support in nnrpd, based on RFC 8315 and libcanlock. Secrets are configured in a new inn-secrets.conf file. see #47
1 parent 6b10dbd commit f25c972

38 files changed

+1425
-87
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@
188188
/tests/lib/artnumber.t
189189
/tests/lib/asprintf.t
190190
/tests/lib/buffer.t
191+
/tests/lib/canlock.t
191192
/tests/lib/concat.t
192193
/tests/lib/conffile.t
193194
/tests/lib/confparse.t

MANIFEST

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ doc/man/ident.8 Manpage for ident resolver
156156
doc/man/incoming.conf.5 Manpage for incoming.conf config file
157157
doc/man/inews.1 Manpage for inews frontend
158158
doc/man/inn-radius.conf.5 Manpage for inn-radius.conf config file
159+
doc/man/inn-secrets.conf.5 Manpage for inn-secrets.conf
159160
doc/man/inn.conf.5 Manpage for inn.conf config file
160161
doc/man/innbind.8 Manpage for innbind
161162
doc/man/inncheck.8 Manpage for inncheck utility
@@ -273,6 +274,7 @@ doc/pod/ident.pod Master file for ident.8
273274
doc/pod/incoming.conf.pod Master file for incoming.conf.5
274275
doc/pod/inews.pod Master file for inews.1
275276
doc/pod/inn-radius.conf.pod Master file for inn-radius.conf.5
277+
doc/pod/inn-secrets.conf.pod Master file for inn-secrets.conf.5
276278
doc/pod/inn.conf.pod Master file for inn.conf.5
277279
doc/pod/innbind.pod Master file for innbind.8
278280
doc/pod/inncheck.pod Master file for inncheck.8
@@ -422,6 +424,7 @@ include/inn/ov.h Header file for old overview API
422424
include/inn/overview.h Header file for the overview API
423425
include/inn/paths.h.in Header file for paths
424426
include/inn/qio.h Header file for quick I/O package
427+
include/inn/secrets.h Header file for the secrets struct
425428
include/inn/sequence.h Header file for sequence space arithmetic
426429
include/inn/storage.h Header file for storage API
427430
include/inn/timer.h Header file for generic timers
@@ -503,6 +506,7 @@ lib/argparse.c Functions for parsing arguments
503506
lib/artnumber.c Manipulation of article numbers
504507
lib/asprintf.c asprintf replacement
505508
lib/buffer.c Reusable counted buffer
509+
lib/canlock.c Routines for Cancel-Lock
506510
lib/cleanfrom.c Clean out a From line
507511
lib/clientactive.c Client access to the active file
508512
lib/clientlib.c Replacement for C News library routine
@@ -557,6 +561,7 @@ lib/remopen.c Open a remote NNTP connection
557561
lib/reservedfd.c File descriptor reservation
558562
lib/resource.c Get process CPU usage
559563
lib/sd-daemon.c Stubs for systemd library functions
564+
lib/secrets.c Parsing and manipulating inn-secrets.conf
560565
lib/sendarticle.c Send an article, NNTP style
561566
lib/sendpass.c Send NNTP authentication
562567
lib/sequence.c Sequence space arithmetic routines
@@ -582,6 +587,7 @@ lib/xwrite.c write that handles partial transfers
582587
m4 Autoconf support macros (Directory)
583588
m4/aux-libs.m4 Autoconf macro for extra libraries
584589
m4/bdb.m4 Autoconf macros for Berkeley DB
590+
m4/canlock.m4 Autoconf macros for Cancel-Lock support
585591
m4/cc-c-o.m4 Autoconf macro for -c -o compiler support
586592
m4/cc-flags.m4 Autoconf macro for compiler flags
587593
m4/compress.m4 Autoconf macro for compress detection
@@ -668,6 +674,7 @@ samples/filter_innd.py Sample Python filter for innd
668674
samples/filter_nnrpd.pl Sample Perl filter for nnrpd
669675
samples/incoming.conf Permissions for incoming feeds
670676
samples/inn-radius.conf Sample config for RADIUS authentication
677+
samples/inn-secrets.conf Sample secrets file
671678
samples/inn.conf.in General INN configuration
672679
samples/innfeed.conf Outgoing feed configuration
673680
samples/innreport.conf.in Log summary configuration
@@ -914,6 +921,7 @@ tests/lib Test suite for libinn (Directory)
914921
tests/lib/artnumber-t.c Tests for lib/artnumber.c
915922
tests/lib/asprintf-t.c Tests for lib/asprintf.c
916923
tests/lib/buffer-t.c Tests for lib/buffer.c
924+
tests/lib/canlock-t.c Tests for lib/canlock.c
917925
tests/lib/concat-t.c Tests for lib/concat.c
918926
tests/lib/conffile-t.c Tests for lib/conffile.c
919927
tests/lib/confparse-t.c Tests for lib/confparse.c

Makefile.global.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,17 @@ KRB5_LIBS = @KRB5_LIBS@
154154

155155
## Systemd support. Additional flags and libraries used when compiling or
156156
## linking code that contains systemd support.
157+
157158
SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
158159
SYSTEMD_LIBS = @SYSTEMD_LIBS@
159160

161+
## libcanlock support. Additional flags and libraries used when compiling or
162+
## linking code that contains Cancel-Lock support.
163+
164+
CANLOCK_CPPFLAGS= @CANLOCK_CPPFLAGS@
165+
CANLOCK_LDFLAGS = @CANLOCK_LDFLAGS@
166+
CANLOCK_LIBS = $(abs_builddir)/lib/canlock$(LIBSUFFIX).o @CANLOCK_LIBS@
167+
160168
## Missing functions. If non-empty, configure detected that your system
161169
## was missing some standard functions, and INN will be providing its own
162170
## replacements from the lib directory.

TODO

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,6 @@ Requested New Features
411411
of stuff that Russ has copies of, for example. [Patches included in
412412
tickets #133 and #134.]
413413

414-
* There are various available patches for Cancel-Lock and an Internet
415-
draft; support should be added to INN for both generation and
416-
verification (definitely optional and not on by default at this point).
417-
418414
* It would be nice to be able to reload inn.conf (although difficult, due
419415
to the amount of data that's generated from it and stashed in various
420416
places).

ci/apt-packages

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
## line, to install for testing.
55

66
default-mta
7+
libcanlock-dev
78
libdb5.3-dev
89
libgd-perl
910
libkrb5-dev

ci/test

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ make test
3131

3232
# Test --enable-keywords and disabling optional dependencies.
3333
make distclean
34-
./configure CC="$COMPILER" --enable-keywords --without-bdb --without-krb5 \
35-
--without-openssl --without-sasl --without-sqlite3 --without-zlib
34+
./configure CC="$COMPILER" --enable-keywords --without-bdb --without-canlock \
35+
--without-krb5 --without-openssl --without-sasl --without-sqlite3 \
36+
--without-zlib
3637
make warnings
3738
make test

configure.ac

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ m4_define_default([AM_CONDITIONAL], [:])
3737
dnl Lots of our macros are stored in separate files for ease of maintenance.
3838
m4_include([m4/aux-libs.m4])
3939
m4_include([m4/bdb.m4])
40+
m4_include([m4/canlock.m4])
4041
m4_include([m4/cc-c-o.m4])
4142
m4_include([m4/cc-flags.m4])
4243
m4_include([m4/compress.m4])
@@ -426,6 +427,7 @@ fi
426427
dnl Handle optional libraries and probing for their locations and component
427428
dnl libraries if needed.
428429
INN_LIB_BDB_OPTIONAL
430+
INN_LIB_CANLOCK_OPTIONAL
429431
INN_LIB_KRB5_OPTIONAL
430432
INN_LIB_OPENSSL_OPTIONAL
431433
INN_LIB_SASL_OPTIONAL

doc/FAQ

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ Subject: 1.1. What is INN?
108108
The README that comes with INN has this to say (in part):
109109

110110
INN (InterNetNews), originally written by Rich Salz, is an extremely
111-
flexible and configurable Usenet / Netnews news server. For a complete
112-
description of the protocols behind Usenet and Netnews, see RFC 3977
113-
(NNTP), RFC 4642 updated by RFC 8143 (TLS/NNTP), RFC 4643 (NNTP
114-
authentication), RFC 4644 (streaming NNTP feeds), RFC 5536 (USEFOR),
115-
RFC 5537 (USEPRO), RFC 6048 (NNTP LIST additions) and RFC 8054 (NNTP
116-
compression) or their replacements.
111+
flexible and configurable Usenet / Netnews news server. For a
112+
complete description of the protocols behind Usenet and Netnews, see
113+
RFC 3977 (NNTP), RFC 4642 updated by RFC 8143 (TLS/NNTP), RFC 4643 (NNTP
114+
authentication), RFC 4644 (streaming NNTP feeds), RFC 5536 (USEFOR), RFC
115+
5537 (USEPRO), RFC 6048 (NNTP LIST additions), RFC 8054 (NNTP compression)
116+
and RFC 8315 (Cancel-Lock) or their replacements.
117117

118118
In brief, Netnews is a set of protocols for exchanging messages between
119119
a decentralized network of news servers. News articles are organized

doc/man/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ SEC3PM = INN__Config.3pm \
1515
SEC5 = active.5 active.times.5 buffindexed.conf.5 control.ctl.5 \
1616
cycbuff.conf.5 distrib.pats.5 distributions.5 expire.ctl.5 \
1717
history.5 incoming.conf.5 \
18-
inn.conf.5 innfeed.conf.5 innreport.conf.5 \
18+
inn.conf.5 innfeed.conf.5 innreport.conf.5 inn-secrets.conf.5 \
1919
innwatch.ctl.5 moderators.5 motd.news.5 \
2020
newsfeeds.5 newsgroups.5 newslog.5 nnrpd.track.5 nntpsend.ctl.5 ovdb.5 \
2121
ovsqlite.5 passwd.nntp.5 inn-radius.conf.5 readers.conf.5 \

doc/pod/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ MAN5 = ../man/active.5 ../man/active.times.5 ../man/buffindexed.conf.5 \
2222
../man/control.ctl.5 ../man/cycbuff.conf.5 ../man/distrib.pats.5 \
2323
../man/distributions.5 ../man/expire.ctl.5 ../man/history.5 \
2424
../man/incoming.conf.5 ../man/inn.conf.5 ../man/innfeed.conf.5 \
25-
../man/innreport.conf.5 ../man/innwatch.ctl.5 ../man/moderators.5 \
25+
../man/innreport.conf.5 ../man/inn-secrets.conf.5 \
26+
../man/innwatch.ctl.5 ../man/moderators.5 \
2627
../man/motd.news.5 ../man/newsfeeds.5 ../man/newsgroups.5 \
2728
../man/newslog.5 ../man/nnrpd.track.5 ../man/nntpsend.ctl.5 \
2829
../man/ovdb.5 ../man/ovsqlite.5 \
@@ -107,6 +108,7 @@ maintclean: distclean
107108
../man/inn.conf.5: inn.conf.pod ; $(POD2MAN) -s 5 $? > $@
108109
../man/innfeed.conf.5: innfeed.conf.pod ; $(POD2MAN) -s 5 $? > $@
109110
../man/innreport.conf.5: innreport.conf.pod ; $(POD2MAN) -s 5 $? > $@
111+
../man/inn-secrets.conf.5: inn-secrets.conf.pod ; $(POD2MAN) -s 5 $? > $@
110112
../man/innwatch.ctl.5: innwatch.ctl.pod ; $(POD2MAN) -s 5 $? > $@
111113
../man/moderators.5: moderators.pod ; $(POD2MAN) -s 5 $? > $@
112114
../man/motd.news.5: motd.news.pod ; $(POD2MAN) -s 5 $? > $@

0 commit comments

Comments
 (0)