Commit Graph

405 Commits

Author SHA1 Message Date
Nick Mathewson
e45810113b Merge branch 'pre_formatter_cleanups_squashed' 2020-01-09 07:32:39 -05:00
Nick Mathewson
d7b8377c28 or_options_st.h: Add an include and a struct declaration.
This frees us from some dependencies on include order.
2020-01-09 07:30:35 -05:00
Nick Mathewson
4f02812242 It's 2020. Update the copyright dates with "make update-copyright" 2020-01-08 18:39:17 -05:00
Nick Mathewson
1b63eea66c Merge branch 'haxxpop/tcp_proxy_squashed' into tcp_proxy_squshed_and_merged 2020-01-06 13:41:20 -05:00
Nick Mathewson
1f498220bd Merge remote-tracking branch 'tor-github/pr/1620' 2020-01-06 13:28:10 -05:00
teor
cd160291a7
Code Style: Delete headers that are included twice
These changes were created using the "make autostyle" from
32522, and then split into commits.
2019-12-20 09:53:31 +10:00
Nick Mathewson
42e31b5c45 Mark TestingEstimatedDescriptorPropagationTime as obsolete.
We stopped looking at this option in 85cf6dcba3, back when we
implemented the minimal pieces of prop275.  Since then, we've had
code to validate and adjust this option, and to give it a different
value in testing networks, but the option hasn't actually done
anything.

We can safely mark it as OBSOLETE, since doing so does not make any
old configuration get rejected.

Closes ticket 32807.
2019-12-19 11:04:48 -05:00
Nick Mathewson
ffa3499d81 Add config object for dirauth; move one option there.
I've chosen the "AuthDirMaxServersPerAddr" option here for
simplicity, since it is used literally nowhere else besides the dirauth
module.  Once we have all the infrastructure in place for this, we
can move more options into this structure.
2019-12-19 07:54:56 -05:00
Nick Mathewson
5e2318165d Add "stub" files for disabled modules.
These modules are only built when the selected modules are disabled.
The provide stub implementations of the subsystem blocks.  Later,
other stub implementations could move here.

Having real subsystem blocks here will let us handle disabled
configuration options better.
2019-12-19 07:54:56 -05:00
Nick Mathewson
fcb5656128 Merge branch 'ticket32609_squashed' 2019-12-04 12:15:28 -05:00
teor
9ad569c71d practracker: Add missing .may_include files
All of these files contain "*.h", except for:
* src/app/config/.may_include
* src/test/.may_include
which also contain "*.inc".

This change prevents includes of "*.c" files, and other
unusually named files.

Part of 32609.
2019-12-04 12:15:22 -05:00
Neel Chauhan
99cf3f99c0 Make control_event_conf_changed() take a config_line_t 2019-11-26 22:12:23 -05:00
Nick Mathewson
ff7d0ebcfe Fix a low-impact memory leak in options_act_reversible()
Found by Coverity as CID 1455953

Fixes bug 32575; bug not in any released Tor.
2019-11-22 09:04:36 -05:00
Nick Mathewson
d8ff7d0236 Merge branch 'reversible_3' 2019-11-21 07:49:18 -05:00
Nick Mathewson
b33f3c960d options_act_reversible: add more comments to explain ordering 2019-11-20 09:49:25 -05:00
Nick Mathewson
a3d06179ce Typo/grammar fixes. 2019-11-20 09:28:12 -05:00
Nick Mathewson
acb97cfa68 log config: Set safelogging_changed even if we aren't running Tor. 2019-11-20 09:26:47 -05:00
Nick Mathewson
89c355b386 Some tests for log changes, commit, and rollback 2019-11-20 09:26:47 -05:00
Nick Mathewson
a30d143228 Make KeyDirectory's GroupReadable behave the same as CacheDirectory's.
In #26913 we solved a bug where CacheDirectoryGroupReadable would
override DataDirectoryGroupReadable when the two directories are the
same.  We never did the same for KeyDirectory, though, because
that's a rare setting.

Now that I'm testing this code, though, fixing this issue seems
fine.  Fixes bug #27992; bugfix on 0.3.3.1-alpha.
2019-11-20 09:26:47 -05:00
Nick Mathewson
cd8c96ce02 Typo fix in warning message about ControlSocket 2019-11-20 09:26:47 -05:00
Nick Mathewson
cf7580ab06 Free options objects for which validation fails.
Also free options objects when we discard them due to
TestingTorOptions.

Fixes bug 32555; bug not in any released Tor.
2019-11-20 09:14:08 -05:00
Nick Mathewson
929b46f44a Split listener configuration out of options_act_reversible() 2019-11-19 16:05:07 -05:00
Nick Mathewson
5060007f4b Split log configuration out of options_act_reversible(). 2019-11-19 16:03:32 -05:00
Nick Mathewson
20c24e72d9 options_act_reversible(): Extract more startup-only pieces.
These have to happen after opening listeners and before opening logs :/
2019-11-19 16:03:10 -05:00
Nick Mathewson
006ce47ffa Extract a function for one-time-only pre-reversible options.
These changes _only_ happen at startup, and happen before _any_
reversible option change is set.
2019-11-19 16:03:10 -05:00
Nick Mathewson
effed7fb1c Move some ControlSocket checks to options_validate_cb()
There is no reason for them be in options_act_reversible().
2019-11-19 16:03:10 -05:00
George Kadianakis
d28b6792cb Merge branch 'tor-github/pr/1423' 2019-11-18 19:06:53 +02:00
teor
c34fb3413d
Merge remote-tracking branch 'tor-github/pr/1517' 2019-11-18 11:21:37 +10:00
Nick Mathewson
183f89ccac Merge remote-tracking branch 'tor-github/pr/1545' 2019-11-16 15:30:00 -05:00
Neel Chauhan
c8859eb754 Remove the extra whitespace around the DARWIN #defines 2019-11-15 15:05:53 -05:00
Nick Mathewson
8b91680d5c Doxygen: rename all .dox files to end with .md
Using a standard ending here will let other tools that expect
markdown understand our output here.

This commit was automatically generated with:

   for fn in $(find src -name '*.dox'); do \
      git mv "$fn" "${fn%.dox}.md"; \
   done
2019-11-15 09:28:12 -05:00
Nick Mathewson
3a7369d0cf Doxygen: remove /** and **/ from all .dox files
This is an automatically generated commit, made with:

find src -name '*.dox' | \
   xargs  perl -i -ne 'print unless (m#^\s*/?\*\*/?\s*$#);'
2019-11-15 09:23:51 -05:00
teor
d19f370aa2 Run "make autostyle" 2019-11-14 16:28:39 +10:00
teor
0df8bcfb6f relay: Disable relay_sys when the relay module is disabled
Closes ticket 32245.
2019-11-14 16:27:06 +10:00
Nick Mathewson
0644530df2 ntmain: make service_fns struct anonymous. 2019-11-07 08:45:08 -05:00
Nick Mathewson
4845ab53f0 Make all our struct names end with "_t".
This is an automated commit, generated by this command:

./scripts/maint/rename_c_identifier.py \
        address_ttl_s address_ttl_t \
        aes_cnt_cipher aes_cnt_cipher_t \
        authchallenge_data_s authchallenge_data_t \
        authenticate_data_s authenticate_data_t \
        cached_bw_event_s cached_bw_event_t \
        cbuf cbuf_t \
        cell_ewma_s cell_ewma_t \
        certs_data_s certs_data_t \
        channel_idmap_entry_s channel_idmap_entry_t \
        channel_listener_s channel_listener_t \
        channel_s channel_t \
        channel_tls_s channel_tls_t \
        circuit_build_times_s circuit_build_times_t \
        circuit_muxinfo_s circuit_muxinfo_t \
        circuitmux_policy_circ_data_s circuitmux_policy_circ_data_t \
        circuitmux_policy_data_s circuitmux_policy_data_t \
        circuitmux_policy_s circuitmux_policy_t \
        circuitmux_s circuitmux_t \
        coord coord_t \
        cpuworker_job_u cpuworker_job_u_t \
        cv_testinfo_s cv_testinfo_t \
        ddmap_entry_s ddmap_entry_t \
        dircollator_s dircollator_t \
        dist_ops dist_ops_t \
        ecdh_work_s ecdh_work_t \
        ewma_policy_circ_data_s ewma_policy_circ_data_t \
        ewma_policy_data_s ewma_policy_data_t \
        fp_pair_map_entry_s fp_pair_map_entry_t \
        fp_pair_map_s fp_pair_map_t \
        guard_selection_s guard_selection_t \
        mbw_cache_entry_s mbw_cache_entry_t \
        outbuf_table_ent_s outbuf_table_ent_t \
        queued_event_s queued_event_t \
        replyqueue_s replyqueue_t \
        rsa_work_s rsa_work_t \
        sandbox_cfg_elem sandbox_cfg_elem_t \
        scheduler_s scheduler_t \
        smp_param smp_param_t \
        socket_table_ent_s socket_table_ent_t \
        state_s state_t \
        threadpool_s threadpool_t \
        timeout_cb timeout_cb_t \
        tor_libevent_cfg tor_libevent_cfg_t \
        tor_threadlocal_s tor_threadlocal_t \
        url_table_ent_s url_table_ent_t \
        worker_state_s worker_state_t \
        workerthread_s workerthread_t \
        workqueue_entry_s workqueue_entry_t
2019-11-07 08:41:22 -05:00
Nick Mathewson
280a9a4760 Move netstatus (mainloop) state fields into mainloop's state. 2019-11-07 07:28:43 -05:00
Nick Mathewson
3afbb29bee subsysmgr: use IDX_NONE is an exception value, not -1. 2019-11-07 07:28:43 -05:00
Nick Mathewson
0f0a9bdf33 Stop using "config_suite_offset=-1" to indicate "no config suite."
Instead, create a separate "has_config_suite" boolean, so that only
top-level formats with config_suites need to declare an offset at
all.
2019-11-07 07:28:43 -05:00
Nick Mathewson
8cd3e66d93 Use new configuration architecture for crypto options
This is a comparatively simple change.
2019-11-07 07:28:43 -05:00
Nick Mathewson
b06e9d8ad5 Add testing-only functions to get the subsystem config/state indices 2019-11-07 07:28:43 -05:00
Nick Mathewson
52c0ab4af3 Add subsys functions for receiving/flushing states and options.
These functions are in the subsystem, not in the config_format_t,
since they are about how the format is _used_, not about _what it
is_.
2019-11-07 07:28:43 -05:00
Nick Mathewson
7ac4f9d5ec Give subsystems optional config formats and state formats.
The formats, when provided, are now added to the global config_mgr_t
objects.
2019-11-07 07:28:43 -05:00
Nick Mathewson
a7cfddc8d1 Make a new structure for tracking subsystem status.
We used to have only one boolean per subsystem, but we're about to
have a little more information.
2019-11-07 07:28:43 -05:00
teor
aaef9a2519 relay: Stop failing on startup when the relay module is disabled
When the relay module is disabled, make "ClientOnly 1" and
"DirCache 0" by default. (But keep "ClientOnly 0" and
"DirCache 1" as the defaults for the unit tests.)

And run "make autostyle".

Part of ticket 32410.
2019-11-07 11:43:41 +10:00
Nick Mathewson
1ee17dc07a OwningControllerFD should be immutable, not OwningControllerProcess.
This is a mistake I made when marking options as immutable.

Fixes bug 32399.  Bug not in any released Tor.
2019-11-06 08:37:32 -05:00
Nick Mathewson
8933789fef Merge branch 'doxygen_libs' 2019-11-05 08:05:49 -05:00
teor
655603c779
Merge remote-tracking branch 'tor-github/pr/1487'
Combine V_IMMUTABLE and FILENAME changes on PidFile.
2019-11-05 14:26:23 +10:00
teor
b9269d6d0a
Merge remote-tracking branch 'tor-github/pr/1486' 2019-11-05 14:23:56 +10:00
teor
6169469546
Merge remote-tracking branch 'tor-github/pr/1477' 2019-11-05 14:23:10 +10:00