summaryrefslogtreecommitdiff
path: root/sshconnect.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshconnect.c')
-rw-r--r--sshconnect.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sshconnect.c b/sshconnect.c
index 21eff6c6..7c47ebe9 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -243,7 +243,11 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
/* Create a socket for connecting. */
sock = ssh_create_socket(original_real_uid,
+#ifdef HAVE_CYGWIN
+ !anonymous && port < IPPORT_RESERVED,
+#else
!anonymous && geteuid() == 0 && port < IPPORT_RESERVED,
+#endif
ai->ai_family);
if (sock < 0)
continue;