git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3695 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-10-29 01:28:03 +00:00
parent 770632d951
commit 545297c6e4
7 changed files with 15 additions and 12 deletions

View File

@@ -335,7 +335,7 @@ int main(int argc, char **argv)
if (argc > 1) {
usage ();
} else if (argc == 1) {
sp = getservbyname (*argv, "tcp");
sp = roken_getservbyname (*argv, "tcp");
if (sp)
port = sp->s_port;
else
@@ -408,7 +408,7 @@ int main(int argc, char **argv)
}
#endif /* _SC_CRAY_SECURE_SYS */
openlog("telnetd", LOG_PID | LOG_ODELAY, LOG_DAEMON);
roken_openlog("telnetd", LOG_PID | LOG_ODELAY, LOG_DAEMON);
fromlen = sizeof (from);
if (getpeername(0, (struct sockaddr *)&from, &fromlen) < 0) {
fprintf(stderr, "%s: ", progname);
@@ -705,7 +705,7 @@ doit(struct sockaddr_in *who)
#endif /* _SC_CRAY_SECURE_SYS */
/* get name of connected client */
hp = gethostbyaddr((const char *)&who->sin_addr,
hp = roken_gethostbyaddr((const char *)&who->sin_addr,
sizeof (struct in_addr),
who->sin_family);

View File

@@ -82,7 +82,7 @@ common_setup(krb5_context *context, int *argc, char **argv,
krb5_errx(*context, 0, "%s", heimdal_version);
if(port_str){
struct servent *s = getservbyname(port_str, "tcp");
struct servent *s = roken_getservbyname(port_str, "tcp");
if(s)
port = s->s_port;
else {

View File

@@ -159,7 +159,7 @@ doit (const char *hostname, int port, const char *service)
struct in_addr **h;
struct hostent *hostent;
hostent = gethostbyname (hostname);
hostent = roken_gethostbyname (hostname);
if (hostent == NULL)
errx (1, "gethostbyname '%s' failed: %s",
hostname,

View File

@@ -175,7 +175,7 @@ doit (const char *hostname, int port, const char *service)
struct in_addr **h;
struct hostent *hostent;
hostent = gethostbyname (hostname);
hostent = roken_gethostbyname (hostname);
if (hostent == NULL)
errx (1, "gethostbyname '%s' failed: %s",
hostname,

View File

@@ -57,7 +57,7 @@ add_port(int family, const char *port_str, const char *protocol)
int port;
int i;
sp = getservbyname(port_str, protocol);
sp = roken_getservbyname(port_str, protocol);
if(sp){
port = sp->s_port;
}else{
@@ -441,12 +441,14 @@ handle_tcp(struct descr *d, int index, int min_free)
n = 0;
}
}
else if(enable_http && strncmp(d[index].buf, "GET ", 4) == 0 &&
strncmp(d[index].buf + d[index].len - 4, "\r\n\r\n", 4) == 0){
else if(enable_http &&
strncmp((char *)d[index].buf, "GET ", 4) == 0 &&
strncmp((char *)d[index].buf + d[index].len - 4,
"\r\n\r\n", 4) == 0){
char *s, *p, *t;
void *data;
int len;
s = d[index].buf;
s = (char *)d[index].buf;
p = strstr(s, "\r\n");
*p = 0;
p = NULL;

View File

@@ -71,7 +71,7 @@ int open_socket(krb5_context context, const char *hostname)
warn("socket");
return -1;
}
hp = gethostbyname(hostname);
hp = roken_gethostbyname(hostname);
if(hp == NULL){
warnx("%s: %s", hostname, hstrerror(h_errno));
close(s);

View File

@@ -94,7 +94,8 @@ int main(int argc, char **argv)
f = fopen(keyfile, "w");
if(f == NULL)
krb5_err(context, 1, errno, "fopen(%s)", keyfile);
encode_EncryptionKey(buf + sizeof(buf) - 1, sizeof(buf), &key, &len);
encode_EncryptionKey((unsigned char *)buf + sizeof(buf) - 1,
sizeof(buf), &key, &len);
fwrite(buf + sizeof(buf) - len, len, 1, f);
fclose(f);
exit(0);