* Send initial GSS authentication token */
| 154 | * Send initial GSS authentication token |
| 155 | */ |
| 156 | static int |
| 157 | pg_GSS_startup(PGconn *conn, int payloadlen) |
| 158 | { |
| 159 | int ret; |
| 160 | char *host = conn->connhost[conn->whichhost].host; |
| 161 | |
| 162 | if (!(host && host[0] != '\0')) |
| 163 | { |
| 164 | appendPQExpBufferStr(&conn->errorMessage, |
| 165 | libpq_gettext("host name must be specified\n")); |
| 166 | return STATUS_ERROR; |
| 167 | } |
| 168 | |
| 169 | if (conn->gctx) |
| 170 | { |
| 171 | appendPQExpBufferStr(&conn->errorMessage, |
| 172 | libpq_gettext("duplicate GSS authentication request\n")); |
| 173 | return STATUS_ERROR; |
| 174 | } |
| 175 | |
| 176 | ret = pg_GSS_load_servicename(conn); |
| 177 | if (ret != STATUS_OK) |
| 178 | return ret; |
| 179 | |
| 180 | /* |
| 181 | * Initial packet is the same as a continuation packet with no initial |
| 182 | * context. |
| 183 | */ |
| 184 | conn->gctx = GSS_C_NO_CONTEXT; |
| 185 | |
| 186 | return pg_GSS_continue(conn, payloadlen); |
| 187 | } |
| 188 | #endif /* ENABLE_GSS */ |
| 189 | |
| 190 |
no test coverage detected