remove all setuid(getuid()). we do not support telnet being setuid root

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8364 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2000-06-09 10:04:27 +00:00
parent acfd1eb956
commit 9fccf03625

View File

@@ -2071,7 +2071,6 @@ tn(int argc, char **argv)
if (connected) {
printf("?Already connected to %s\r\n", hostname);
setuid(getuid());
return 0;
}
if (argc < 2) {
@@ -2112,7 +2111,6 @@ tn(int argc, char **argv)
}
usage:
printf("usage: %s [-l user] [-a] host-name [port]\r\n", cmd);
setuid(getuid());
return 0;
}
if (hostp == 0)
@@ -2147,7 +2145,6 @@ tn(int argc, char **argv)
port = sp->s_port;
else {
printf("%s: bad port number\r\n", portp);
setuid(getuid());
return 0;
}
} else {
@@ -2158,7 +2155,6 @@ tn(int argc, char **argv)
sp = roken_getservbyname("telnet", "tcp");
if (sp == 0) {
fprintf(stderr, "telnet: tcp/telnet: unknown service\r\n");
setuid(getuid());
return 0;
}
port = sp->s_port;
@@ -2181,7 +2177,6 @@ tn(int argc, char **argv)
error = getaddrinfo (hostname, portstr, &hints, &ai);
if (error) {
fprintf (stderr, "%s: %s\r\n", hostname, gai_strerror (error));
setuid (getuid ());
return 0;
}
@@ -2199,7 +2194,6 @@ tn(int argc, char **argv)
printf("Trying %s...\r\n", addrstr);
net = socket (a->ai_family, a->ai_socktype, a->ai_protocol);
setuid (getuid ());
if (net < 0) {
warn ("socket");
continue;