]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Kill duplicated code in connection_listener_new()
authorAndrea Shepard <andrea@torproject.org>
Mon, 12 Jan 2015 16:26:34 +0000 (16:26 +0000)
committerAndrea Shepard <andrea@torproject.org>
Mon, 12 Jan 2015 16:26:34 +0000 (16:26 +0000)
src/or/connection.c

index c78cebad709b5da80b84684b8301e8c839ed8351..9866c4c8046cd391d2e55847f55bb4cbfd7320e9 100644 (file)
@@ -1234,18 +1234,10 @@ connection_listener_new(const struct sockaddr *listensockaddr,
     }
 #endif
 
-    if (type == CONN_TYPE_CONTROL_LISTENER &&
-        options->ControlSocketsGroupWritable) {
-      /* We need to use chmod; fchmod doesn't work on sockets on all
-       * platforms. */
-      if (chmod(address, 0660) < 0) {
-        log_warn(LD_FS,"Unable to make %s group-writable.", address);
-        goto err;
-      }
-    }
-
-    if (type == CONN_TYPE_AP_LISTENER &&
-        options->SocksSocketsGroupWritable) {
+    if ((type == CONN_TYPE_CONTROL_LISTENER &&
+         options->ControlSocketsGroupWritable) ||
+        (type == CONN_TYPE_AP_LISTENER &&
+         options->SocksSocketsGroupWritable)) {
       /* We need to use chmod; fchmod doesn't work on sockets on all
        * platforms. */
       if (chmod(address, 0660) < 0) {