--- negotiate_kerberos_auth.cc 2010-02-09 19:16:27.000000000 +0000 +++ negotiate_kerberos_auth-new.cc 2010-02-09 19:16:03.000000000 +0000 @@ -120,14 +120,14 @@ rc = gethostname(hostname, sysconf(_SC_HOST_NAME_MAX)); if (rc) { - fprintf(stderr, "%s| %s: error while resolving hostname '%s'\n", + fprintf(stderr, "%s| %s: ERROR: resolving hostname '%s' failed\n", LogTime(), PROGRAM, hostname); return NULL; } rc = xgetaddrinfo(hostname, NULL, NULL, &hres); if (rc != 0) { fprintf(stderr, - "%s| %s: error while resolving hostname with getaddrinfo: %s\n", + "%s| %s: ERROR: resolving hostname with getaddrinfo: %s failed\n", LogTime(), PROGRAM, xgai_strerror(rc)); return NULL; } @@ -141,7 +141,7 @@ sizeof(hostname), NULL, 0, 0); if (rc != 0) { fprintf(stderr, - "%s| %s: error while resolving ip address with getnameinfo: %s\n", + "%s| %s: ERROR: resolving ip address with getnameinfo: %s failed\n", LogTime(), PROGRAM, xgai_strerror(rc)); xfreeaddrinfo(hres); return NULL; @@ -199,11 +199,11 @@ gss_release_buffer(&min_stat, &status_string); } if (debug) - fprintf(stderr, "%s| %s: %s failed: %s\n", LogTime(), PROGRAM, + fprintf(stderr, "%s| %s: ERROR: %s failed: %s\n", LogTime(), PROGRAM, function, buf); fprintf(stdout, "BH %s failed: %s\n", function, buf); if (log) - fprintf(stderr, "%s| %s: User not authenticated\n", LogTime(), + fprintf(stderr, "%s| %s: INFO: User not authenticated\n", LogTime(), PROGRAM); return (1); } @@ -267,13 +267,13 @@ fprintf(stderr, "default SPN is HTTP/fqdn@DEFAULT_REALM\n"); exit(0); default: - fprintf(stderr, "%s| %s: unknown option: -%c.\n", LogTime(), + fprintf(stderr, "%s| %s: WARNING: unknown option: -%c.\n", LogTime(), PROGRAM, opt); } } if (debug) - fprintf(stderr, "%s| %s: Starting version %s\n", LogTime(), PROGRAM, + fprintf(stderr, "%s| %s: INFO: Starting version %s\n", LogTime(), PROGRAM, SQUID_KERB_AUTH_VERSION); if (service_principal && strcasecmp(service_principal, "GSS_C_NO_NAME")) { service.value = service_principal; @@ -282,7 +282,7 @@ host_name = gethost_name(); if (!host_name) { fprintf(stderr, - "%s| %s: Local hostname could not be determined. Please specify the service principal\n", + "%s| %s: FATAL: Local hostname could not be determined. Please specify the service principal\n", LogTime(), PROGRAM); fprintf(stdout, "BH hostname error\n"); exit(-1); @@ -298,7 +298,7 @@ if (ferror(stdin)) { if (debug) fprintf(stderr, - "%s| %s: fgets() failed! dying..... errno=%d (%s)\n", + "%s| %s: FATAL: fgets() failed! dying..... errno=%d (%s)\n", LogTime(), PROGRAM, ferror(stdin), strerror(ferror(stdin))); @@ -318,7 +318,7 @@ } if (err) { if (debug) - fprintf(stderr, "%s| %s: Oversized message\n", LogTime(), + fprintf(stderr, "%s| %s: ERROR: Oversized message\n", LogTime(), PROGRAM); fprintf(stdout, "BH Oversized message\n"); err = 0; @@ -326,12 +326,12 @@ } if (debug) - fprintf(stderr, "%s| %s: Got '%s' from squid (length: %d).\n", + fprintf(stderr, "%s| %s: DEBUG: Got '%s' from squid (length: %d).\n", LogTime(), PROGRAM, buf, length); if (buf[0] == '\0') { if (debug) - fprintf(stderr, "%s| %s: Invalid request\n", LogTime(), + fprintf(stderr, "%s| %s: ERROR: Invalid request\n", LogTime(), PROGRAM); fprintf(stdout, "BH Invalid request\n"); continue; @@ -339,7 +339,7 @@ if (strlen(buf) < 2) { if (debug) - fprintf(stderr, "%s| %s: Invalid request [%s]\n", LogTime(), + fprintf(stderr, "%s| %s: ERROR: Invalid request [%s]\n", LogTime(), PROGRAM, buf); fprintf(stdout, "BH Invalid request\n"); continue; @@ -382,7 +382,7 @@ if (strncmp(buf, "YR", 2) && strncmp(buf, "KK", 2)) { if (debug) - fprintf(stderr, "%s| %s: Invalid request [%s]\n", LogTime(), + fprintf(stderr, "%s| %s: ERROR: Invalid request [%s]\n", LogTime(), PROGRAM, buf); fprintf(stdout, "BH Invalid request\n"); continue; @@ -395,7 +395,7 @@ if (strlen(buf) <= 3) { if (debug) - fprintf(stderr, "%s| %s: Invalid negotiate request [%s]\n", + fprintf(stderr, "%s| %s: ERROR: Invalid negotiate request [%s]\n", LogTime(), PROGRAM, buf); fprintf(stdout, "BH Invalid negotiate request\n"); continue; @@ -403,7 +403,7 @@ input_token.length = ska_base64_decode_len(buf + 3); if (debug) - fprintf(stderr, "%s| %s: Decode '%s' (decoded length: %d).\n", + fprintf(stderr, "%s| %s: DEBUG: Decode '%s' (decoded length: %d).\n", LogTime(), PROGRAM, buf + 3, (int) input_token.length); input_token.value = xmalloc(input_token.length); @@ -413,7 +413,7 @@ if ((input_token.length >= sizeof ntlmProtocol + 1) && (!memcmp(input_token.value, ntlmProtocol, sizeof ntlmProtocol))) { if (debug) - fprintf(stderr, "%s| %s: received type %d NTLM token\n", + fprintf(stderr, "%s| %s: WARNING: received type %d NTLM token\n", LogTime(), PROGRAM, (int) *((unsigned char *) input_token.value + sizeof ntlmProtocol)); @@ -462,7 +462,7 @@ token = (char*)xmalloc(ska_base64_encode_len(spnegoTokenLength)); if (token == NULL) { if (debug) - fprintf(stderr, "%s| %s: Not enough memory\n", LogTime(), + fprintf(stderr, "%s| %s: ERROR: Not enough memory\n", LogTime(), PROGRAM); fprintf(stdout, "BH Not enough memory\n"); goto cleanup; @@ -476,7 +476,7 @@ goto cleanup; if (major_status & GSS_S_CONTINUE_NEEDED) { if (debug) - fprintf(stderr, "%s| %s: continuation needed\n", LogTime(), + fprintf(stderr, "%s| %s: INFO: continuation needed\n", LogTime(), PROGRAM); fprintf(stdout, "TT %s\n", token); goto cleanup; @@ -492,7 +492,7 @@ user = (char*)xmalloc(output_token.length + 1); if (user == NULL) { if (debug) - fprintf(stderr, "%s| %s: Not enough memory\n", LogTime(), + fprintf(stderr, "%s| %s: ERROR: Not enough memory\n", LogTime(), PROGRAM); fprintf(stdout, "BH Not enough memory\n"); goto cleanup; @@ -504,10 +504,10 @@ } fprintf(stdout, "AF %s %s\n", token, user); if (debug) - fprintf(stderr, "%s| %s: AF %s %s\n", LogTime(), PROGRAM, token, + fprintf(stderr, "%s| %s: DEBUG: AF %s %s\n", LogTime(), PROGRAM, token, user); if (log) - fprintf(stderr, "%s| %s: User %s authenticated\n", LogTime(), + fprintf(stderr, "%s| %s: INFO: User %s authenticated\n", LogTime(), PROGRAM, user); goto cleanup; } else { @@ -516,7 +516,7 @@ goto cleanup; if (major_status & GSS_S_CONTINUE_NEEDED) { if (debug) - fprintf(stderr, "%s| %s: continuation needed\n", LogTime(), + fprintf(stderr, "%s| %s: INFO: continuation needed\n", LogTime(), PROGRAM); fprintf(stdout, "NA %s\n", token); goto cleanup; @@ -535,7 +535,7 @@ user = (char*)xmalloc(output_token.length + 1); if (user == NULL) { if (debug) - fprintf(stderr, "%s| %s: Not enough memory\n", LogTime(), + fprintf(stderr, "%s| %s: ERROR: Not enough memory\n", LogTime(), PROGRAM); fprintf(stdout, "BH Not enough memory\n"); goto cleanup; @@ -547,10 +547,10 @@ } fprintf(stdout, "AF %s %s\n", "AA==", user); if (debug) - fprintf(stderr, "%s| %s: AF %s %s\n", LogTime(), PROGRAM, + fprintf(stderr, "%s| %s: DEBUG: AF %s %s\n", LogTime(), PROGRAM, "AA==", user); if (log) - fprintf(stderr, "%s| %s: User %s authenticated\n", LogTime(), + fprintf(stderr, "%s| %s: INFO: User %s authenticated\n", LogTime(), PROGRAM, user); }