30 OM_uint32 msg_ctx = 0;
34 if (gss_display_status(&lmin_s,
stat,
type, GSS_C_NO_OID,
35 &msg_ctx, &lmsg) != GSS_S_COMPLETE)
39 gss_release_buffer(&lmin_s, &lmsg);
48 OM_uint32 maj_stat, OM_uint32 min_stat)
65 gss_cred_id_t cred = GSS_C_NO_CREDENTIAL;
67 major = gss_acquire_cred(&minor, GSS_C_NO_NAME, 0, GSS_C_NO_OID_SET,
68 GSS_C_INITIATE, &cred, NULL, NULL);
69 if (major != GSS_S_COMPLETE)
87 gss_buffer_desc temp_gbuf;
90 if (
conn->gtarg_nam != NULL)
95 if (!(host && host[0] !=
'\0'))
106 temp_gbuf.value = (
char *)
malloc(maxlen);
107 if (!temp_gbuf.value)
112 snprintf(temp_gbuf.value, maxlen,
"%s@%s",
114 temp_gbuf.length = strlen(temp_gbuf.value);
116 maj_stat = gss_import_name(&min_stat, &temp_gbuf,
117 GSS_C_NT_HOSTBASED_SERVICE, &
conn->gtarg_nam);
118 free(temp_gbuf.value);
120 if (maj_stat != GSS_S_COMPLETE)
char * PQhost(const PGconn *conn)
void pg_GSS_error(const char *mprefix, PGconn *conn, OM_uint32 maj_stat, OM_uint32 min_stat)
int pg_GSS_load_servicename(PGconn *conn)
static void pg_GSS_error_int(PQExpBuffer str, OM_uint32 stat, int type)
bool pg_GSS_have_cred_cache(gss_cred_id_t *cred_out)
void libpq_append_conn_error(PGconn *conn, const char *fmt,...)
void appendPQExpBuffer(PQExpBuffer str, const char *fmt,...)
void appendBinaryPQExpBuffer(PQExpBuffer str, const char *data, size_t datalen)
void appendPQExpBufferChar(PQExpBuffer str, char ch)
PQExpBufferData errorMessage