diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2011-04-23 02:57:53 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-05-15 20:20:28 -0400 |
commit | 4198261291c8edbd5ba1617b7bfe3563e51edbe7 (patch) | |
tree | 62e0cd1b1aad01a4b40b59d1faa69c644f5252d4 /src | |
parent | d41ac64ad68811d8575db6e456fba470b0c3fde7 (diff) | |
download | tor-4198261291c8edbd5ba1617b7bfe3563e51edbe7.tar.gz tor-4198261291c8edbd5ba1617b7bfe3563e51edbe7.zip |
Clean up the 2972 implementation a little
Diffstat (limited to 'src')
-rw-r--r-- | src/or/config.c | 14 | ||||
-rw-r--r-- | src/or/connection.c | 4 | ||||
-rw-r--r-- | src/or/or.h | 2 |
3 files changed, 13 insertions, 7 deletions
diff --git a/src/or/config.c b/src/or/config.c index c81fc9c594..614fc48c3e 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -209,7 +209,7 @@ static config_var_t _option_vars[] = { V(ControlPortFileGroupReadable,BOOL, "0"), V(ControlPortWriteToFile, FILENAME, NULL), V(ControlSocket, LINELIST, NULL), - V(UnixSocketsGroupWritable, BOOL, "0"), + V(ControlSocketsGroupWritable, BOOL, "0"), V(CookieAuthentication, BOOL, "0"), V(CookieAuthFileGroupReadable, BOOL, "0"), V(CookieAuthFile, STRING, NULL), @@ -953,9 +953,15 @@ options_act_reversible(or_options_t *old_options, char **msg) } #ifndef HAVE_SYS_UN_H - if (options->ControlSocket || options->UnixSocketsGroupWritable) { - *msg = tor_strdup("Unix domain sockets (ControlSocket) not supported" - " on this OS/with this build."); + if (options->ControlSocket || options->ControlSocketsGroupWritable) { + *msg = tor_strdup("Unix domain sockets (ControlSocket) not supported " + "on this OS/with this build."); + goto rollback; + } +#else + if (options->ControlSocketsGroupWritable && !options->ControlSocket) { + *msg = tor_strdup("Setting ControlSocketGroupWritable without setting" + "a ControlSocket makes no sense."); goto rollback; } #endif diff --git a/src/or/connection.c b/src/or/connection.c index d0898c5e5c..12e00e59bb 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -966,9 +966,9 @@ connection_create_listener(const struct sockaddr *listensockaddr, tor_socket_strerror(tor_socket_errno(s))); goto err; } - if (get_options()->UnixSocketsGroupWritable) { + if (get_options()->ControlSocketsGroupWritable) { if (chmod(address, 0660) < 0) { - log_warn(LD_FS,"Unable to make %s group-readable.", address); + log_warn(LD_FS,"Unable to make %s group-writable.", address); tor_close_socket(s); goto err; } diff --git a/src/or/or.h b/src/or/or.h index b72693f029..b9d8319ba5 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -2445,7 +2445,7 @@ typedef struct { int ControlPort; /**< Port to listen on for control connections. */ config_line_t *ControlSocket; /**< List of Unix Domain Sockets to listen on * for control connections. */ - int UnixSocketsGroupWritable; /**< Boolean: Are unix sockets g+rw? */ + int ControlSocketsGroupWritable; /**< Boolean: Are control sockets g+rw? */ int DirPort; /**< Port to listen on for directory connections. */ int DNSPort; /**< Port to listen on for DNS requests. */ int AssumeReachable; /**< Whether to publish our descriptor regardless. */ |