=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/telnet/commands.c,v retrieving revision 1.8 retrieving revision 1.9 diff -c -r1.8 -r1.9 *** src/usr.bin/telnet/commands.c 1996/12/06 15:21:53 1.8 --- src/usr.bin/telnet/commands.c 1996/12/22 03:26:08 1.9 *************** *** 1,4 **** ! /* $OpenBSD: commands.c,v 1.8 1996/12/06 15:21:53 robin Exp $ */ /* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: commands.c,v 1.9 1996/12/22 03:26:08 tholo Exp $ */ /* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */ /* *************** *** 39,45 **** static char sccsid[] = "@(#)commands.c 8.4 (Berkeley) 5/30/95"; static char rcsid[] = "$NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $"; #else ! static char rcsid[] = "$OpenBSD: commands.c,v 1.8 1996/12/06 15:21:53 robin Exp $"; #endif #endif /* not lint */ --- 39,45 ---- static char sccsid[] = "@(#)commands.c 8.4 (Berkeley) 5/30/95"; static char rcsid[] = "$NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $"; #else ! static char rcsid[] = "$OpenBSD: commands.c,v 1.9 1996/12/22 03:26:08 tholo Exp $"; #endif #endif /* not lint */ *************** *** 2144,2149 **** --- 2144,2150 ---- if (connected) { printf("?Already connected to %s\n", hostname); + seteuid(getuid()); setuid(getuid()); return 0; } *************** *** 2193,2198 **** --- 2194,2200 ---- } usage: printf("usage: %s [-l user] [-a] host-name [port]\n", cmd); + seteuid(getuid()); setuid(getuid()); return 0; } *************** *** 2208,2217 **** --- 2210,2221 ---- temp = sourceroute(hostp, &srp, &srlen); if (temp == 0) { herror(srp); + seteuid(getuid()); setuid(getuid()); return 0; } else if (temp == -1) { printf("Bad source route option: %s\n", hostp); + seteuid(getuid()); setuid(getuid()); return 0; } else { *************** *** 2245,2250 **** --- 2249,2255 ---- hostname = _hostname; } else { herror(hostp); + seteuid(getuid()); setuid(getuid()); return 0; } *************** *** 2265,2270 **** --- 2270,2276 ---- sin.sin_port = sp->s_port; else { printf("%s: bad port number\n", portp); + seteuid(getuid()); setuid(getuid()); return 0; } *************** *** 2279,2284 **** --- 2285,2291 ---- sp = getservbyname("telnet", "tcp"); if (sp == 0) { fprintf(stderr, "telnet: tcp/telnet: unknown service\n"); + seteuid(getuid()); setuid(getuid()); return 0; } *************** *** 2289,2294 **** --- 2296,2302 ---- printf("Trying %s...\n", inet_ntoa(sin.sin_addr)); do { net = socket(AF_INET, SOCK_STREAM, 0); + seteuid(getuid()); setuid(getuid()); if (net < 0) { perror("telnet: socket");