Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mike Perry
Tor
Commits
1b16fcb7
Commit
1b16fcb7
authored
May 09, 2019
by
Nick Mathewson
⛰
Browse files
Add a --list-modules command
Closes ticket 30452.
parent
231036a1
Changes
4
Hide whitespace changes
Inline
Side-by-side
changes/bug30452
0 → 100644
View file @
1b16fcb7
o Minor features (compile-time modules):
- Add a --list-modules command to print a list of which compile-time
modules are enabled. Closes ticket 30452.
doc/tor.1.txt
View file @
1b16fcb7
...
@@ -88,6 +88,10 @@ COMMAND-LINE OPTIONS
...
@@ -88,6 +88,10 @@ COMMAND-LINE OPTIONS
List all valid options that are scheduled to become obsolete in a
List all valid options that are scheduled to become obsolete in a
future version. (This is a warning, not a promise.)
future version. (This is a warning, not a promise.)
[[opt-list-modules]] **--list-modules**::
For each optional module, list whether or not it has been compiled
into Tor. (Any module not listed is not optional in this version of Tor.)
[[opt-version]] **--version**::
[[opt-version]] **--version**::
Display Tor version and exit.
Display Tor version and exit.
...
...
src/app/config/config.c
View file @
1b16fcb7
...
@@ -2474,6 +2474,7 @@ static const struct {
...
@@ -2474,6 +2474,7 @@ static const struct {
{
"--quiet"
,
TAKES_NO_ARGUMENT
},
{
"--quiet"
,
TAKES_NO_ARGUMENT
},
{
"--hush"
,
TAKES_NO_ARGUMENT
},
{
"--hush"
,
TAKES_NO_ARGUMENT
},
{
"--version"
,
TAKES_NO_ARGUMENT
},
{
"--version"
,
TAKES_NO_ARGUMENT
},
{
"--list-modules"
,
TAKES_NO_ARGUMENT
},
{
"--library-versions"
,
TAKES_NO_ARGUMENT
},
{
"--library-versions"
,
TAKES_NO_ARGUMENT
},
{
"-h"
,
TAKES_NO_ARGUMENT
},
{
"-h"
,
TAKES_NO_ARGUMENT
},
{
"--help"
,
TAKES_NO_ARGUMENT
},
{
"--help"
,
TAKES_NO_ARGUMENT
},
...
@@ -2695,6 +2696,13 @@ list_deprecated_options(void)
...
@@ -2695,6 +2696,13 @@ list_deprecated_options(void)
}
}
}
}
/** Print all compile-time modules and their enabled/disabled status. */
static
void
list_enabled_modules
(
void
)
{
printf
(
"%s: %s
\n
"
,
"dirauth"
,
have_module_dirauth
()
?
"yes"
:
"no"
);
}
/** Last value actually set by resolve_my_address. */
/** Last value actually set by resolve_my_address. */
static
uint32_t
last_resolved_addr
=
0
;
static
uint32_t
last_resolved_addr
=
0
;
...
@@ -5198,6 +5206,11 @@ options_init_from_torrc(int argc, char **argv)
...
@@ -5198,6 +5206,11 @@ options_init_from_torrc(int argc, char **argv)
return
1
;
return
1
;
}
}
if
(
config_line_find
(
cmdline_only_options
,
"--list-modules"
))
{
list_enabled_modules
();
return
1
;
}
if
(
config_line_find
(
cmdline_only_options
,
"--library-versions"
))
{
if
(
config_line_find
(
cmdline_only_options
,
"--library-versions"
))
{
printf
(
"Tor version %s.
\n
"
,
get_version
());
printf
(
"Tor version %s.
\n
"
,
get_version
());
printf
(
"Library versions
\t
Compiled
\t\t
Runtime
\n
"
);
printf
(
"Library versions
\t
Compiled
\t\t
Runtime
\n
"
);
...
...
src/feature/dirauth/authmode.h
View file @
1b16fcb7
...
@@ -27,6 +27,8 @@ authdir_mode_v3(const or_options_t *options)
...
@@ -27,6 +27,8 @@ authdir_mode_v3(const or_options_t *options)
return
authdir_mode
(
options
)
&&
options
->
V3AuthoritativeDir
!=
0
;
return
authdir_mode
(
options
)
&&
options
->
V3AuthoritativeDir
!=
0
;
}
}
#define have_module_dirauth() (1)
#else
/* HAVE_MODULE_DIRAUTH */
#else
/* HAVE_MODULE_DIRAUTH */
#define authdir_mode(options) (((void)(options)),0)
#define authdir_mode(options) (((void)(options)),0)
...
@@ -37,6 +39,8 @@ authdir_mode_v3(const or_options_t *options)
...
@@ -37,6 +39,8 @@ authdir_mode_v3(const or_options_t *options)
#define authdir_mode_bridge(options) (((void)(options)),0)
#define authdir_mode_bridge(options) (((void)(options)),0)
#define authdir_mode_v3(options) (((void)(options)),0)
#define authdir_mode_v3(options) (((void)(options)),0)
#define have_module_dirauth() (0)
#endif
/* HAVE_MODULE_DIRAUTH */
#endif
/* HAVE_MODULE_DIRAUTH */
#endif
/* TOR_MODE_H */
#endif
/* TOR_MODE_H */
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment