From 682b33709135db4cf7ebe23238a9377dfefec5da Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Sat, 14 Oct 2000 18:24:17 +0000 Subject: [PATCH] * kpropd.c, kprop.c: Ensure size of database sent OTW as 4 bytes instead of sizeof(int). In the past we assumed that the client and server had the same concept on int size. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12757 dc483132-0cff-0310-8789-dd5450dbe970 --- src/slave/ChangeLog | 5 +++++ src/slave/kprop.c | 14 +++++++++----- src/slave/kpropd.c | 10 ++++++---- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/slave/ChangeLog b/src/slave/ChangeLog index b49d64689..14fab3359 100644 --- a/src/slave/ChangeLog +++ b/src/slave/ChangeLog @@ -1,3 +1,8 @@ +Sat Oct 14 14:16:20 2000 Ezra Peisach + + * kpropd.c, kprop.c: Ensure size of database sent OTW as 4 bytes + instead of sizeof(int). + 2000-08-03 Ezra Peisach * kprop.c, kpropd.c: Compiler warning fixes including: not diff --git a/src/slave/kprop.c b/src/slave/kprop.c index ec3995fc8..ff54eb603 100644 --- a/src/slave/kprop.c +++ b/src/slave/kprop.c @@ -323,7 +323,7 @@ open_connection(host, fd, Errmsg, ErrmsgSz) struct hostent *hp; register struct servent *sp; struct sockaddr_in my_sin; - int socket_length; + unsigned int socket_length; hp = gethostbyname(host); if (hp == NULL) { @@ -532,20 +532,24 @@ close_database(context, fd) * will abort the entire operation. */ void -xmit_database(context, auth_context, my_creds, fd, database_fd, database_size) +xmit_database(context, auth_context, my_creds, fd, database_fd, + in_database_size) krb5_context context; krb5_auth_context auth_context; krb5_creds *my_creds; int fd; int database_fd; - int database_size; + int in_database_size; { - krb5_int32 send_size, sent_size, n; + krb5_int32 sent_size, n; krb5_data inbuf, outbuf; char buf[KPROP_BUFSIZ]; krb5_error_code retval; krb5_error *error; - + /* These must be 4 bytes */ + krb5_ui_4 database_size = in_database_size; + krb5_ui_4 send_size; + /* * Send over the size */ diff --git a/src/slave/kpropd.c b/src/slave/kpropd.c index bdd7deb19..a5a7c05f4 100644 --- a/src/slave/kpropd.c +++ b/src/slave/kpropd.c @@ -168,7 +168,8 @@ void do_standalone() { struct sockaddr_in my_sin, frominet; struct servent *sp; - int finet, fromlen, s; + int finet, s; + unsigned int fromlen; int ret; finet = socket(AF_INET, SOCK_STREAM, 0); @@ -258,7 +259,8 @@ void doit(fd) int fd; { struct sockaddr_in from; - int on = 1, fromlen; + int on = 1; + unsigned int fromlen; struct hostent *hp; krb5_error_code retval; krb5_data confmsg; @@ -533,7 +535,7 @@ kerberos_authenticate(context, fd, clientp, etype, my_sin) krb5_error_code retval; krb5_ticket * ticket; struct sockaddr_in r_sin; - int sin_length; + unsigned int sin_length; krb5_keytab keytab = NULL; /* @@ -704,7 +706,7 @@ recv_database(context, fd, database_fd, confmsg) int database_fd; krb5_data *confmsg; { - int database_size; + krb5_ui_4 database_size; /* This must be 4 bytes */ int received_size, n; char buf[1024]; krb5_data inbuf, outbuf; -- 2.26.2