From: Amos Jeffries Date: Sat, 12 Sep 2009 08:01:56 +0000 (+1200) Subject: Fix some c++ build errors in Kerberos helper X-Git-Tag: SQUID_3_2_0_1~612^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7e5e0e2c8e0f59cc9f2ec1ef5616ebfdd2529227;p=thirdparty%2Fsquid.git Fix some c++ build errors in Kerberos helper --- diff --git a/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc b/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc index 6ee901398e..49ad4c8d40 100644 --- a/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc +++ b/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc @@ -289,7 +289,7 @@ main(int argc, char *const argv[]) exit(-1); } service.value = xmalloc(strlen(service_name) + strlen(host_name) + 2); - snprintf(service.value, strlen(service_name) + strlen(host_name) + 2, + snprintf((char*)service.value, strlen(service_name) + strlen(host_name) + 2, "%s@%s", service_name, host_name); service.length = strlen((char *) service.value); } @@ -310,7 +310,7 @@ main(int argc, char *const argv[]) exit(0); } - c = memchr(buf, '\n', sizeof(buf) - 1); + c = (char*)memchr(buf, '\n', sizeof(buf) - 1); if (c) { *c = '\0'; length = c - buf; @@ -408,7 +408,7 @@ main(int argc, char *const argv[]) LogTime(), PROGRAM, buf + 3, (int) input_token.length); input_token.value = xmalloc(input_token.length); - ska_base64_decode(input_token.value, buf + 3, input_token.length); + ska_base64_decode((char*)input_token.value, buf + 3, input_token.length); #if !HAVE_SPNEGO @@ -517,10 +517,10 @@ main(int argc, char *const argv[]) spnegoTokenLength = output_token.length; } #else - spnegoToken = output_token.value; + spnegoToken = (unsigned char *)output_token.value; spnegoTokenLength = output_token.length; #endif - token = xmalloc(ska_base64_encode_len(spnegoTokenLength)); + token = (char*)xmalloc(ska_base64_encode_len(spnegoTokenLength)); if (token == NULL) { if (debug) fprintf(stderr, "%s| %s: Not enough memory\n", LogTime(), @@ -550,7 +550,7 @@ main(int argc, char *const argv[]) if (check_gss_err(major_status, minor_status, "gss_display_name()", debug, log)) goto cleanup; - user = xmalloc(output_token.length + 1); + user = (char*)xmalloc(output_token.length + 1); if (user == NULL) { if (debug) fprintf(stderr, "%s| %s: Not enough memory\n", LogTime(), @@ -593,7 +593,7 @@ main(int argc, char *const argv[]) /* * Return dummy token AA. May need an extra return tag then AF */ - user = xmalloc(output_token.length + 1); + user = (char*)xmalloc(output_token.length + 1); if (user == NULL) { if (debug) fprintf(stderr, "%s| %s: Not enough memory\n", LogTime(), diff --git a/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc b/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc index 2f57355088..8041156357 100644 --- a/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc +++ b/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc @@ -170,8 +170,7 @@ squid_kerb_proxy_auth(char *proxy) } service.value = xmalloc(strlen("HTTP") + strlen(proxy) + 2); - snprintf(service.value, strlen("HTTP") + strlen(proxy) + 2, "%s@%s", "HTTP", - proxy); + snprintf((char*)service.value, strlen("HTTP") + strlen(proxy) + 2, "%s@%s", "HTTP", proxy); service.length = strlen((char *) service.value); major_status = gss_import_name(&minor_status, &service, @@ -196,7 +195,7 @@ squid_kerb_proxy_auth(char *proxy) goto cleanup; if (output_token.length) { - token = xmalloc(ska_base64_encode_len(output_token.length)); + token = (char*)xmalloc(ska_base64_encode_len(output_token.length)); ska_base64_encode(token, (const char *) output_token.value, ska_base64_encode_len(output_token.length), output_token.length); }