/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 mandos.conf

  • Committer: teddy at recompile
  • Date: 2020-04-05 21:30:59 UTC
  • Revision ID: teddy@recompile.se-20200405213059-fb2a61ckqynrmatk
Fix file descriptor leak in mandos-client

When the local network has Mandos servers announcing themselves using
real, globally reachable, IPv6 addresses (i.e. not link-local
addresses), but there is no router on the local network providing IPv6
RA (Router Advertisement) packets, the client cannot reach the server
by normal means, since the client only has a link-local IPv6 address,
and has no usable route to reach the server's global IPv6 address.
(This is not a common situation, and usually only happens when the
router itself reboots and runs a Mandos client, since it cannot then
give RA packets to itself.)  The client code has a solution for
this, which consists of adding a temporary local route to reach the
address of the server during communication, and removing this
temporary route afterwards.

This solution with a temporary route works, but has a file descriptor
leak; it leaks one file descriptor for each addition and for each
removal of a route.  If one server requiring an added route is present
on the network, but no servers gives a password, making the client
retry after the default ten seconds, and we furthermore assume a
default 1024 open files limit, the client runs out of file descriptors
after about 90 minutes, after which time the client process will be
useless and fail to retrieve any passwords, necessitating manual
password entry via the keyboard.

Fix this by eliminating the file descriptor leak in the client.

* plugins.d/mandos-client.c (add_delete_local_route): Do
  close(devnull) also in parent process, also if fork() fails, and on
  any failure in child process.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
# These are the default values for the server, uncomment and change
5
5
# them if needed.
6
6
 
7
 
 
8
7
# If "interface" is set, the server will only listen to a specific
9
8
# network interface.
10
9
;interface = 
11
10
 
12
 
 
13
11
# If "address" is set, the server will only listen to a specific
14
12
# address.  This must currently be an IPv6 address; an IPv4 address
15
13
# can be specified using the "::FFFF:192.0.2.3" syntax.  Also, if this
16
14
# is a link-local address, an interface should be set above.
17
15
;address =
18
16
 
19
 
 
20
17
# If "port" is set, the server to bind to that port. By default, the
21
18
# server will listen to an arbitrary port.
22
19
;port = 
23
20
 
24
 
 
25
21
# If "debug" is true, the server will run in the foreground and print
26
22
# a lot of debugging information.
27
23
;debug = False
28
24
 
29
 
 
30
25
# GnuTLS priority for the TLS handshake.  See gnutls_priority_init(3).
31
 
;priority = SECURE256:!CTYPE-X.509:+CTYPE-OPENPGP
32
 
 
 
26
;priority = SECURE256:!CTYPE-X.509:+CTYPE-OPENPGP:!RSA:+SIGN-DSA-SHA256
33
27
 
34
28
# Zeroconf service name.  You need to change this if you for some
35
29
# reason want to run more than one server on the same *host*.
36
30
# If there are name collisions on the same *network*, the server will
37
31
# rename itself to "Mandos #2", etc.
38
32
;servicename = Mandos
 
33
 
 
34
# Whether to provide a D-Bus system bus interface or not
 
35
;use_dbus = True
 
36
 
 
37
# Whether to use IPv6.  (Changing this is NOT recommended.)
 
38
;use_ipv6 = True
 
39
 
 
40
# Whether to restore saved state on startup
 
41
;restore = True
 
42
 
 
43
# The directory where state is saved
 
44
;statedir = /var/lib/mandos
 
45
 
 
46
# Whether to run in the foreground
 
47
;foreground = False
 
48
 
 
49
# File descriptor number to use for network socket
 
50
;socket = 
 
51
 
 
52
# Whether to use ZeroConf; if false, requires port or socket
 
53
;zeroconf = True