|
Lines 143-158
Link Here
|
| 143 |
|
143 |
|
| 144 |
old_umask = umask(0177); |
144 |
old_umask = umask(0177); |
| 145 |
if (bind(muxserver_sock, (struct sockaddr *)&addr, addr_len) == -1) { |
145 |
if (bind(muxserver_sock, (struct sockaddr *)&addr, addr_len) == -1) { |
| 146 |
muxserver_sock = -1; |
|
|
| 147 |
if (errno == EINVAL || errno == EADDRINUSE) { |
146 |
if (errno == EINVAL || errno == EADDRINUSE) { |
| 148 |
error("ControlSocket %s already exists, " |
147 |
error("ControlSocket %s already exists, " |
| 149 |
"disabling multiplexing", options.control_path); |
148 |
"recreating socket", options.control_path); |
| 150 |
close(muxserver_sock); |
149 |
unlink(options.control_path); |
| 151 |
muxserver_sock = -1; |
150 |
if (bind(muxserver_sock, (struct sockaddr *)&addr, addr_len) == -1) { |
| 152 |
xfree(options.control_path); |
151 |
if (errno == EINVAL || errno == EADDRINUSE) { |
| 153 |
options.control_path = NULL; |
152 |
error("ControlSocket %s already exists, " |
| 154 |
options.control_master = SSHCTL_MASTER_NO; |
153 |
"disabling multiplexing", options.control_path); |
| 155 |
return; |
154 |
close(muxserver_sock); |
|
|
155 |
muxserver_sock = -1; |
| 156 |
xfree(options.control_path); |
| 157 |
options.control_path = NULL; |
| 158 |
options.control_master = SSHCTL_MASTER_NO; |
| 159 |
return; |
| 160 |
} else |
| 161 |
fatal("%s bind(): %s", __func__, strerror(errno)); |
| 162 |
} |
| 156 |
} else |
163 |
} else |
| 157 |
fatal("%s bind(): %s", __func__, strerror(errno)); |
164 |
fatal("%s bind(): %s", __func__, strerror(errno)); |
| 158 |
} |
165 |
} |