Deleted Added
full compact
rlogin.c (50477) rlogin.c (56590)
1/*
2 * Copyright (c) 1983, 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 26 unchanged lines hidden (view full) ---

35static const char copyright[] =
36"@(#) Copyright (c) 1983, 1990, 1993\n\
37 The Regents of the University of California. All rights reserved.\n";
38#endif /* not lint */
39
40#ifndef lint
41static const char sccsid[] = "@(#)rlogin.c 8.1 (Berkeley) 6/6/93";
42static const char rcsid[] =
1/*
2 * Copyright (c) 1983, 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 26 unchanged lines hidden (view full) ---

35static const char copyright[] =
36"@(#) Copyright (c) 1983, 1990, 1993\n\
37 The Regents of the University of California. All rights reserved.\n";
38#endif /* not lint */
39
40#ifndef lint
41static const char sccsid[] = "@(#)rlogin.c 8.1 (Berkeley) 6/6/93";
42static const char rcsid[] =
43 "$FreeBSD: head/usr.bin/rlogin/rlogin.c 50477 1999-08-28 01:08:13Z peter $";
43 "$FreeBSD: head/usr.bin/rlogin/rlogin.c 56590 2000-01-25 14:52:10Z shin $";
44#endif /* not lint */
45
46/*
47 * rlogin - remote login
48 */
49#include <sys/param.h>
50#include <sys/socket.h>
51#include <sys/time.h>

--- 97 unchanged lines hidden (view full) ---

149 struct servent *sp;
150 struct sgttyb ttyb;
151 long omask;
152 int argoff, ch, dflag, Dflag, one, uid;
153 char *host, *localname, *p, *user, term[1024];
154#ifdef KERBEROS
155 char *k;
156#endif
44#endif /* not lint */
45
46/*
47 * rlogin - remote login
48 */
49#include <sys/param.h>
50#include <sys/socket.h>
51#include <sys/time.h>

--- 97 unchanged lines hidden (view full) ---

149 struct servent *sp;
150 struct sgttyb ttyb;
151 long omask;
152 int argoff, ch, dflag, Dflag, one, uid;
153 char *host, *localname, *p, *user, term[1024];
154#ifdef KERBEROS
155 char *k;
156#endif
157 struct sockaddr_storage ss;
158 int sslen;
157
158 argoff = dflag = Dflag = 0;
159 one = 1;
160 host = localname = user = NULL;
161
162 if ((p = rindex(argv[0], '/')))
163 ++p;
164 else

--- 161 unchanged lines hidden (view full) ---

326 newargv[argc + 1] = NULL;
327 execv(_PATH_RLOGIN, newargv);
328 }
329 } else {
330#ifdef CRYPT
331 if (doencrypt)
332 errx(1, "the -x flag requires Kerberos authentication");
333#endif /* CRYPT */
159
160 argoff = dflag = Dflag = 0;
161 one = 1;
162 host = localname = user = NULL;
163
164 if ((p = rindex(argv[0], '/')))
165 ++p;
166 else

--- 161 unchanged lines hidden (view full) ---

328 newargv[argc + 1] = NULL;
329 execv(_PATH_RLOGIN, newargv);
330 }
331 } else {
332#ifdef CRYPT
333 if (doencrypt)
334 errx(1, "the -x flag requires Kerberos authentication");
335#endif /* CRYPT */
334 rem = rcmd(&host, sp->s_port, localname, user, term, 0);
336 rem = rcmd_af(&host, sp->s_port, localname, user, term, 0,
337 PF_UNSPEC);
335 }
336#else
338 }
339#else
337 rem = rcmd(&host, sp->s_port, localname, user, term, 0);
340 rem = rcmd_af(&host, sp->s_port, localname, user, term, 0, PF_UNSPEC);
338#endif /* KERBEROS */
339
340 if (rem < 0)
341 exit(1);
342
343 if (dflag &&
344 setsockopt(rem, SOL_SOCKET, SO_DEBUG, &one, sizeof(one)) < 0)
345 warn("setsockopt");
346 if (Dflag &&
347 setsockopt(rem, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)) < 0)
348 warn("setsockopt NODELAY (ignored)");
349
341#endif /* KERBEROS */
342
343 if (rem < 0)
344 exit(1);
345
346 if (dflag &&
347 setsockopt(rem, SOL_SOCKET, SO_DEBUG, &one, sizeof(one)) < 0)
348 warn("setsockopt");
349 if (Dflag &&
350 setsockopt(rem, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)) < 0)
351 warn("setsockopt NODELAY (ignored)");
352
353 sslen = sizeof(ss);
350 one = IPTOS_LOWDELAY;
354 one = IPTOS_LOWDELAY;
351 if (setsockopt(rem, IPPROTO_IP, IP_TOS, (char *)&one, sizeof(int)) < 0)
352 warn("setsockopt TOS (ignored)");
355 if (getsockname(rem, (struct sockaddr *)&ss, &sslen) == 0 &&
356 ss.ss_family == AF_INET) {
357 if (setsockopt(rem, IPPROTO_IP, IP_TOS, (char *)&one,
358 sizeof(int)) < 0)
359 warn("setsockopt TOS (ignored)");
360 } else
361 if (ss.ss_family == AF_INET)
362 warn("setsockopt getsockname failed");
353
354 (void)setuid(uid);
355 doit(omask);
356 /*NOTREACHED*/
357}
358
359int child, defflags, deflflags, tabflag;
360char deferase, defkill;

--- 567 unchanged lines hidden ---
363
364 (void)setuid(uid);
365 doit(omask);
366 /*NOTREACHED*/
367}
368
369int child, defflags, deflflags, tabflag;
370char deferase, defkill;

--- 567 unchanged lines hidden ---