From 545297c6e42cc694c43b79b4f76f24d78c0046ce Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Wed, 29 Oct 1997 01:28:03 +0000 Subject: [PATCH] roken_* git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3695 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/telnet/telnetd/telnetd.c | 6 +++--- appl/test/common.c | 2 +- appl/test/gssapi_client.c | 2 +- appl/test/tcp_client.c | 2 +- kdc/connect.c | 10 ++++++---- kdc/hprop.c | 2 +- kdc/kstash.c | 3 ++- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/appl/telnet/telnetd/telnetd.c b/appl/telnet/telnetd/telnetd.c index 3744e514b..6639d4907 100644 --- a/appl/telnet/telnetd/telnetd.c +++ b/appl/telnet/telnetd/telnetd.c @@ -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); diff --git a/appl/test/common.c b/appl/test/common.c index e9646d8aa..69d0766fe 100644 --- a/appl/test/common.c +++ b/appl/test/common.c @@ -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 { diff --git a/appl/test/gssapi_client.c b/appl/test/gssapi_client.c index 308f45e19..a444476c1 100644 --- a/appl/test/gssapi_client.c +++ b/appl/test/gssapi_client.c @@ -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, diff --git a/appl/test/tcp_client.c b/appl/test/tcp_client.c index 5173101f0..ddad43260 100644 --- a/appl/test/tcp_client.c +++ b/appl/test/tcp_client.c @@ -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, diff --git a/kdc/connect.c b/kdc/connect.c index 400e68e7d..24239716e 100644 --- a/kdc/connect.c +++ b/kdc/connect.c @@ -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; diff --git a/kdc/hprop.c b/kdc/hprop.c index 307f892b5..1d9d0195e 100644 --- a/kdc/hprop.c +++ b/kdc/hprop.c @@ -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); diff --git a/kdc/kstash.c b/kdc/kstash.c index aa263f399..efad50439 100644 --- a/kdc/kstash.c +++ b/kdc/kstash.c @@ -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);