]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix some c++ build errors in Kerberos helper
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 12 Sep 2009 08:01:56 +0000 (20:01 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 12 Sep 2009 08:01:56 +0000 (20:01 +1200)
helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc
helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc

index 6ee901398ecc67339b870d4676ef54f686079184..49ad4c8d404934d854899a2742cf01341f2b44e2 100644 (file)
@@ -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(),
index 2f573550880c8c2e09158cc9c2b9c1bc56b8de31..804115635792d4accb9900d0f5c9763afd890d10 100644 (file)
@@ -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);
     }