X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=kerberos.c;h=141c9e3a390fee3776c0a50e64f1a6ceb3bb075f;hb=5c7da5cc729148aace14fdf4b088554bddb7447c;hp=15c8ee7ea28f0e33d5e5d7b23c1b7fb0aced308a;hpb=9dc0b8bd674f71f8ee422b037dc409f2dd4f9487;p=~andy%2Ffetchmail diff --git a/kerberos.c b/kerberos.c index 15c8ee7e..141c9e3a 100644 --- a/kerberos.c +++ b/kerberos.c @@ -32,7 +32,7 @@ typedef long int32; #error Cannot deduce a 32-bit-type #endif -int do_rfc1731(int sock, char *command, char *truename) +int do_rfc1731(int sock, const char *command, const char *truename) /* authenticate as per RFC1731 -- note 32-bit integer requirement here */ { int result = 0, len; @@ -65,7 +65,7 @@ int do_rfc1731(int sock, char *command, char *truename) * in network byte order. */ - if (result = gen_recv(sock, buf1, sizeof buf1)) { + if ((result = gen_recv(sock, buf1, sizeof buf1)) != 0) { return result; } @@ -103,7 +103,7 @@ int do_rfc1731(int sock, char *command, char *truename) strncpy(srvrealm, (char *)krb_realmofhost(srvinst), (sizeof srvrealm)-1); srvrealm[(sizeof srvrealm)-1] = '\0'; - if (p = strchr(srvinst, '.')) { + if ((p = strchr(srvinst, '.')) != NULL) { *p = '\0'; } @@ -186,7 +186,7 @@ int do_rfc1731(int sock, char *command, char *truename) * checksum it previously sent. */ - if (result = gen_recv(sock, buf1, sizeof buf1)) + if ((result = gen_recv(sock, buf1, sizeof buf1)) != 0) return result; /* The client must construct data with the first four octets @@ -241,15 +241,15 @@ int do_rfc1731(int sock, char *command, char *truename) while (authenticator.length & 7) { authenticator.length++; } - des_pcbc_encrypt((des_cblock *)authenticator.dat, - (des_cblock *)authenticator.dat, authenticator.length, schedule, + des_pcbc_encrypt((const unsigned char *)authenticator.dat, + (unsigned char *)authenticator.dat, authenticator.length, schedule, &session, 1); to64frombits(buf1, authenticator.dat, authenticator.length); /* ship down the response, accept the server's error/ok indication */ suppress_tags = TRUE; - result = gen_transact(sock, buf1, strlen(buf1)); + result = gen_transact(sock, "%s", buf1); suppress_tags = FALSE; if (result) return(result);