summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-09-05 16:13:06 +1100
committerDamien Miller <djm@mindrot.org>2000-09-05 16:13:06 +1100
commitbac2d8aa5e642a70045e713853b13d020b9c5d57 (patch)
tree98ddc81efce2273b3dfaff03b51242c988d30abf /ssh.c
parent676092fad0b6edca8f1fe731d7c3a000465a9bef (diff)
- (djm) Merge cygwin support from Corinna Vinschen <vinschen@cygnus.com>
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ssh.c b/ssh.c
index 71d8f96fe..c117ad5ed 100644
--- a/ssh.c
+++ b/ssh.c
@@ -215,6 +215,7 @@ main(int ac, char **av)
215 original_real_uid = getuid(); 215 original_real_uid = getuid();
216 original_effective_uid = geteuid(); 216 original_effective_uid = geteuid();
217 217
218#ifndef HAVE_CYGWIN
218 /* If we are installed setuid root be careful to not drop core. */ 219 /* If we are installed setuid root be careful to not drop core. */
219 if (original_real_uid != original_effective_uid) { 220 if (original_real_uid != original_effective_uid) {
220 struct rlimit rlim; 221 struct rlimit rlim;
@@ -222,6 +223,7 @@ main(int ac, char **av)
222 if (setrlimit(RLIMIT_CORE, &rlim) < 0) 223 if (setrlimit(RLIMIT_CORE, &rlim) < 0)
223 fatal("setrlimit failed: %.100s", strerror(errno)); 224 fatal("setrlimit failed: %.100s", strerror(errno));
224 } 225 }
226#endif
225 /* 227 /*
226 * Use uid-swapping to give up root privileges for the duration of 228 * Use uid-swapping to give up root privileges for the duration of
227 * option processing. We will re-instantiate the rights when we are 229 * option processing. We will re-instantiate the rights when we are
@@ -253,8 +255,17 @@ main(int ac, char **av)
253 cp = strrchr(av0, '/') + 1; 255 cp = strrchr(av0, '/') + 1;
254 else 256 else
255 cp = av0; 257 cp = av0;
258#ifdef HAVE_CYGWIN
259 if (strcasecmp(cp, "rsh") && strcasecmp(cp, "ssh") &&
260 strcasecmp(cp, "rlogin") && strcasecmp(cp, "slogin") &&
261 strcasecmp(cp, "remsh") &&
262 strcasecmp(cp, "rsh.exe") && strcasecmp(cp, "ssh.exe") &&
263 strcasecmp(cp, "rlogin.exe") && strcasecmp(cp, "slogin.exe") &&
264 strcasecmp(cp, "remsh.exe"))
265#else
256 if (strcmp(cp, "rsh") && strcmp(cp, "ssh") && strcmp(cp, "rlogin") && 266 if (strcmp(cp, "rsh") && strcmp(cp, "ssh") && strcmp(cp, "rlogin") &&
257 strcmp(cp, "slogin") && strcmp(cp, "remsh")) 267 strcmp(cp, "slogin") && strcmp(cp, "remsh"))
268#endif
258 host = cp; 269 host = cp;
259 270
260 for (optind = 1; optind < ac; optind++) { 271 for (optind = 1; optind < ac; optind++) {
@@ -551,7 +562,12 @@ main(int ac, char **av)
551 } 562 }
552 } 563 }
553 /* Disable rhosts authentication if not running as root. */ 564 /* Disable rhosts authentication if not running as root. */
565#ifdef HAVE_CYGWIN
566 /* Ignore uid if running under Windows */
567 if (!options.use_privileged_port) {
568#else
554 if (original_effective_uid != 0 || !options.use_privileged_port) { 569 if (original_effective_uid != 0 || !options.use_privileged_port) {
570#endif
555 options.rhosts_authentication = 0; 571 options.rhosts_authentication = 0;
556 options.rhosts_rsa_authentication = 0; 572 options.rhosts_rsa_authentication = 0;
557 } 573 }