From 1ef7df551d8efc0a74536006c17bdaa3cbb0931d Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Tue, 1 Mar 2016 17:08:14 +0100 Subject: First RelaxDirModeCheck implementation --- src/or/config.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/or/config.c') diff --git a/src/or/config.c b/src/or/config.c index 544b032f3a..556d285346 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -6325,7 +6325,8 @@ parse_port_config(smartlist_t *out, ipv4_traffic = 1, ipv6_traffic = 0, prefer_ipv6 = 0, cache_ipv4 = 1, use_cached_ipv4 = 0, cache_ipv6 = 0, use_cached_ipv6 = 0, - prefer_ipv6_automap = 1, world_writable = 0, group_writable = 0; + prefer_ipv6_automap = 1, world_writable = 0, group_writable = 0, relax_dirmode_check = 0, + has_used_unix_socket_only_option = 0; smartlist_split_string(elts, ports->value, NULL, SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); @@ -6478,9 +6479,15 @@ parse_port_config(smartlist_t *out, if (!strcasecmp(elt, "GroupWritable")) { group_writable = !no; + has_used_unix_socket_only_option = 1; continue; } else if (!strcasecmp(elt, "WorldWritable")) { world_writable = !no; + has_used_unix_socket_only_option = 1; + continue; + } else if (!strcasecmp(elt, "RelaxDirModeCheck")) { + relax_dirmode_check = !no; + has_used_unix_socket_only_option = 1; continue; } @@ -6568,9 +6575,9 @@ parse_port_config(smartlist_t *out, goto err; } - if ( (world_writable || group_writable) && ! unix_socket_path) { - log_warn(LD_CONFIG, "You have a %sPort entry with GroupWritable " - "or WorldWritable set, but it is not a unix socket.", portname); + if ( has_used_unix_socket_only_option && ! unix_socket_path) { + log_warn(LD_CONFIG, "You have a %sPort entry with GroupWritable, " + "WorldWritable, or StrictDirModes, but it is not a unix socket.", portname); goto err; } @@ -6596,6 +6603,7 @@ parse_port_config(smartlist_t *out, cfg->type = listener_type; cfg->is_world_writable = world_writable; cfg->is_group_writable = group_writable; + cfg->relax_dirmode_check = relax_dirmode_check; cfg->entry_cfg.isolation_flags = isolation; cfg->entry_cfg.session_group = sessiongroup; cfg->server_cfg.no_advertise = no_advertise; -- cgit v1.2.3-54-g00ecf From d8626d34e59ceb1a71b23646b9c1c1f4fec88638 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 14 Mar 2016 20:27:53 +0100 Subject: Fix log message: say RelaxDirModeCheck instead of StrictDirModes --- src/or/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/or/config.c') diff --git a/src/or/config.c b/src/or/config.c index 556d285346..ea41ca8479 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -6577,7 +6577,7 @@ parse_port_config(smartlist_t *out, if ( has_used_unix_socket_only_option && ! unix_socket_path) { log_warn(LD_CONFIG, "You have a %sPort entry with GroupWritable, " - "WorldWritable, or StrictDirModes, but it is not a unix socket.", portname); + "WorldWritable, or RelaxDirModeCheck, but it is not a unix socket.", portname); goto err; } -- cgit v1.2.3-54-g00ecf