openbsd-ports/net/netatalk/patches/patch-etcafpd-sendtokdcc

95 lines
3.0 KiB
Plaintext

--- etc/afpd/send_to_kdc.c.orig Sun Nov 20 12:34:54 1994
+++ etc/afpd/send_to_kdc.c Thu Nov 11 14:40:34 1999
@@ -35,7 +35,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
-#include <strings.h>
+#incldue <string.h>
#define S_AD_SZ sizeof(struct sockaddr_in)
@@ -85,6 +85,7 @@
* after several retries
*/
+int
send_to_kdc(pkt,rpkt,realm)
KTEXT pkt;
KTEXT rpkt;
@@ -106,7 +107,7 @@
* local realm.
*/
if (realm)
- (void) strcpy(lrealm, realm);
+ (void)strlcpy(lrealm, realm, sizeof(lrealm) );
else
if (krb_get_lrealm(lrealm,1)) {
if (krb_debug)
@@ -127,7 +128,7 @@
if (krb_debug)
printf("krb_udp_port is %d\n", krb_udp_port);
}
- bzero((char *)&to, S_AD_SZ);
+ memset((char *)&to, 0, S_AD_SZ);
hostlist = (struct hostent *) malloc(sizeof(struct hostent));
if (!hostlist)
return (/*errno */SKDC_CANT);
@@ -166,7 +167,7 @@
sizeof(struct hostent)*(n_hosts+1));
if (!hostlist)
return /*errno */SKDC_CANT;
- bcopy((char *)host, (char *)&hostlist[n_hosts-1],
+ memcpy((char *)&hostlist[n_hosts-1], (char *)host,
sizeof(struct hostent));
host = &hostlist[n_hosts-1];
cp = malloc((unsigned)host->h_length);
@@ -174,7 +175,7 @@
retval = /*errno */SKDC_CANT;
goto rtn;
}
- bcopy((char *)host->h_addr, cp, host->h_length);
+ memcpy( cp, (char *)host->h_addr, host->h_length);
/* At least Sun OS version 3.2 (or worse) and Ultrix version 2.2
(or worse) only return one name ... */
#if !(defined(ULTRIX022) || (defined(SunOS) && SunOS < 40))
@@ -185,10 +186,10 @@
}
#endif /* ULTRIX022 || SunOS */
host->h_addr = cp;
- bzero((char *)&hostlist[n_hosts],
+ memset((char *)&hostlist[n_hosts], 0,
sizeof(struct hostent));
to.sin_family = host->h_addrtype;
- bcopy(host->h_addr, (char *)&to.sin_addr,
+ memcpy((char *)&to.sin_addr, host->h_addr,
host->h_length);
to.sin_port = krb_udp_port;
if (send_recv(pkt, rpkt, f, &to, hostlist)) {
@@ -211,7 +212,7 @@
for (retry = 0; retry < CLIENT_KRB_RETRY; ++retry) {
for (host = hostlist; host->h_name != (char *)NULL; host++) {
to.sin_family = host->h_addrtype;
- bcopy(host->h_addr, (char *)&to.sin_addr,
+ memcpy((char *)&to.sin_addr, host->h_addr,
host->h_length);
if (send_recv(pkt, rpkt, f, &to, hostlist)) {
retval = KSUCCESS;
@@ -244,6 +245,7 @@
* return 1 on success, 0 on failure
*/
+int
static send_recv(pkt,rpkt,f,_to,addrs)
KTEXT pkt;
KTEXT rpkt;
@@ -303,7 +305,7 @@
fflush(stdout);
}
for (hp = addrs; hp->h_name != (char *)NULL; hp++) {
- if (!bcmp(hp->h_addr, (char *)&from.sin_addr.s_addr,
+ if (!memcmp(hp->h_addr, (char *)&from.sin_addr.s_addr,
hp->h_length)) {
if (krb_debug) {
printf("Received it\n");