mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Fix a segfault during startup
If unix socket was configured as listener (such as a ControlSocket or a SocksPort unix socket), and tor was started as root but not configured to switch to another user, tor would segfault while trying to string compare a NULL value. Fixes bug 18261; bugfix on 0.2.8.1-alpha. Patch by weasel.
This commit is contained in:
parent
2d879bd39f
commit
42e131e9ac
6
changes/bug18261
Normal file
6
changes/bug18261
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
o Minor features (crypto):
|
||||||
|
- Fix a segfault during startup: If unix socket was configured as
|
||||||
|
listener (such as a ControlSocket or a SocksPort unix socket), and
|
||||||
|
tor was started as root but not configured to switch to another
|
||||||
|
user, tor would segfault while trying to string compare a NULL
|
||||||
|
value. Fixes bug 18261; bugfix on 0.2.8.1-alpha. Patch by weasel.
|
@ -2398,7 +2398,7 @@ retry_listener_ports(smartlist_t *old_conns,
|
|||||||
/* We don't need to be root to create a UNIX socket, so defer until after
|
/* We don't need to be root to create a UNIX socket, so defer until after
|
||||||
* setuid. */
|
* setuid. */
|
||||||
const or_options_t *options = get_options();
|
const or_options_t *options = get_options();
|
||||||
if (port->is_unix_addr && !geteuid() && strcmp(options->User, "root"))
|
if (port->is_unix_addr && !geteuid() && (options->User) && strcmp(options->User, "root"))
|
||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user