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