47 Commits

Author SHA1 Message Date
Tobias Brunner
1b4d97dbb7 charon: Unlink PID file after daemon deinit (i.e. after unloading plugins etc.)
Make sure, though, that we only remove the file if we actually
created it (e.g. not for --help or --version).  And do so before
deinitializing libstrongswan due to leak detective.

Fixes #2460.
2017-11-10 10:55:43 +01:00
Tobias Brunner
9665686bd8 daemon: Use separate method to set default loggers
This way it is not necessary to pass the same values to reload the
loggers.
2017-01-25 14:58:09 +01:00
Tobias Brunner
28649f6d91 libhydra: Remove empty unused library 2016-03-03 17:36:11 +01:00
Tobias Brunner
88b85e022a sigwaitinfo() may fail with EINTR if interrupted by an unblocked signal not in the set
Fixes #1213.
2015-11-23 11:37:19 +01:00
Tobias Brunner
858148092d Replace usages of sigwait(3) with sigwaitinfo(2)
This is basically the same call, but it has the advantage of being
supported by FreeBSD's valgrind, which sigwait() is not.

References #1106.
2015-10-29 15:38:37 +01:00
Martin Willi
68da3bad57 settings: Use strongswan.conf used during library initialization for reload
Since 4b670a20 we require an explicit strongswan.conf to re-load configurations.
However, the define was missing in the build, breaking SIGHUP based config
reloading.

Fixes #651.
2014-09-22 13:40:39 +02:00
Martin Willi
866514c70c charon: Set CLOEXEC flag on daemon PID file and /dev/(u)random source FDs
On Fedora, SELinux complains about these open file descriptors when the
updown script invokes iptables. While it seems difficult to set the flag
on all file descriptors, this at least fixes those covered by the SELinux
policy.

As these two cases are in code executed while the daemon is still single
threaded, we avoid the use of atomic but not fully portable fdopen("e") or
open(O_CLOEXEC) calls.

Fixes #519.
2014-06-24 15:26:38 +02:00
Tobias Brunner
4b670a20a9 settings: strongswan.conf must be loaded explicitly 2014-05-15 11:28:10 +02:00
Tobias Brunner
1c306c0ee9 libcharon: Remove unused charon->name 2014-02-12 14:34:33 +01:00
Tobias Brunner
10c4f4e1fd libhydra: Remove unused hydra->daemon 2014-02-12 14:34:32 +01:00
Tobias Brunner
34d3bfcf14 lib: Add global config namespace 2014-02-12 14:34:31 +01:00
Tobias Brunner
68b7448eab capabilities: Make the user and group charon(-nm) changes to configurable 2013-06-25 17:16:33 +02:00
Tobias Brunner
a2eb581781 capabilities: Move global capabilities_t instance to libstrongswan 2013-06-25 17:16:32 +02:00
Tobias Brunner
607f8e9906 plugin-loader: Add method to print loaded plugins on a given log level 2013-06-21 15:17:53 +02:00
Martin Willi
1f69412b4d When receiving critical signals, additionally log backtraces to syslog/files 2013-03-04 15:46:34 +01:00
Adrian-Ken Rueegsegger
a25047e412 Return SS_RC_INITIALIZATION_FAILED if pid file exists
Let charon return SS_RC_INITIALIZATION_FAILED if an existing pid file is found.
Starter only terminates itself if the result code of the daemon is a valid
SS_RC_* value.
2013-01-23 15:59:21 +01:00
Tobias Brunner
3555bacac7 Reload logger configuration on SIGHUP
Besides changing the configuration this allows to easily rotate log files.

Also moved logger initialization back to daemon_t.
2012-10-18 14:42:10 +02:00
Tobias Brunner
d35d669180 Make syslog and file loggers configurable at runtime 2012-10-18 14:42:10 +02:00
Tobias Brunner
56d07af3be Added ESP log group for libipsec log messages. 2012-08-08 15:12:25 +02:00
Martin Willi
0619ddfaa4 Refactored heavily #ifdefd capability code to its own libstrongswan class 2012-07-04 11:01:40 +02:00
Martin Willi
b8e17eb36f Show some uname() info during charon startup 2012-06-28 11:56:15 +02:00
Andreas Steffen
a71f0f3bdc charon is now an IKE daemon 2012-05-03 20:48:01 +02:00
Tobias Brunner
18758e3d2e Store the name of the binary using libcharon to enable specific settings. 2012-05-03 13:57:04 +02:00
Tobias Brunner
94b48e071a Provide plugin list from charon, not internally in libcharon. 2012-05-03 13:14:07 +02:00
Tobias Brunner
ead92870b8 Loggers specify what log messages they want to receive during registration.
This also allows us to generate the log message only once for all
loggers that need it (avoids calls to custom printf specifier callbacks).

To update the log levels loggers can simply be registered again.
2012-05-02 14:45:38 +02:00
Tobias Brunner
0e474f9148 Use a separate interface for loggers.
The new interface does not allow loggers to unregister themselves from
the bus.  This allows us to use a rwlock_t for them.

The latter also means that loggers can now be called concurrently by
multiple threads.
2012-05-02 14:45:38 +02:00
Tobias Brunner
5895c2e948 Option added to set identifier for syslog(3) logging.
This identifier is added to each log message by syslog.
2012-04-20 09:26:12 +02:00
Tobias Brunner
54d096a712 Added ASN debug group to log low-level encoding/decoding (ASN.1, X.509).
This will allow us to remove quite some clutter from the LIB debug group
for higher debug levels.
2011-12-16 16:44:38 +01:00
Tobias Brunner
bdbbab35b1 pluto: Switch to user 'vpn' on Android. 2011-10-18 11:36:52 +02:00
Tobias Brunner
6d36f8b60a Make sure the PID read from charon.pid is null-terminated. 2011-09-28 13:57:59 +02:00
Andreas Steffen
b9d61f78d3 added PTS debug class 2011-09-11 00:11:04 +02:00
Andreas Steffen
a6cb374136 added DBG_IMC and DBG_IMV debug options 2011-05-29 10:25:13 +02:00
Martin Willi
3b71d3d033 Reload strongswan.conf and plugins supporting reloading on SIGHUP 2011-04-15 10:07:13 +02:00
Martin Willi
84f89634ef Moved logger initialization from libcharon to charon 2011-01-05 16:45:40 +01:00
Andreas Steffen
ed08f7ce83 use DBG_TNC for TNC debugging output 2010-10-09 16:01:19 +02:00
Andreas Steffen
99dfc3c295 added --debug-tls to charon usage() function 2010-10-07 09:34:56 +02:00
Andreas Steffen
4776500055 added debug-tls comand line option 2010-08-23 17:51:40 +02:00
Tobias Brunner
4f9b82bc1d Fixed compiler warning. 2010-06-15 19:58:59 +02:00
Tobias Brunner
404960e522 Run as vpn user on Android. 2010-06-15 19:57:31 +02:00
Tobias Brunner
b02a03a5dd Truncate the PID file so that even if we fail to unlink it, the daemon can be restarted properly. 2010-06-15 19:57:14 +02:00
Martin Willi
091d178060 Option to skip slow addr2line resolution in leak-detective 2010-05-20 17:37:18 +02:00
Tobias Brunner
9d843ee6fa Do a proper cleanup when printing usage info. 2010-05-04 18:34:27 +02:00
Tobias Brunner
9ed6341d3f Adding support for debug groups in libstrongswan's logger. 2010-04-06 12:47:40 +02:00
Tobias Brunner
facf887253 Store the name of the daemon that initialized libhydra to load daemon-specific settings. 2010-04-06 12:47:40 +02:00
Tobias Brunner
a1f90c7a85 Fixed deinit for charon --version. 2010-03-24 18:53:10 +01:00
Tobias Brunner
52bff307e1 Init/deinit libhydra in charon and pluto. 2010-03-24 18:53:10 +01:00
Tobias Brunner
349fa52852 Replacing the original charon with a small wrapper around libcharon. 2010-03-19 13:34:52 +01:00