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;
}
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;
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);
}
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;
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);
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)));
}
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;
}
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;
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;
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;
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;
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);
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));
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;
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;
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;
}
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 {
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;
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;
}
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);
}