else
fprintf(stderr, "Authentication failed, conn %d.\n", conn);
- return auth;
+ return !auth;
}
static int tids_read_request (TIDS_INSTANCE *tids, int conn, gss_ctx_id_t *gssctx, TR_MSG **mreq)
int rc = 0;
gss_ctx_id_t gssctx = GSS_C_NO_CONTEXT;
- if (!tids_auth_connection(conn, &gssctx)) {
+ if (tids_auth_connection(conn, &gssctx)) {
fprintf(stderr, "Error authorizing TID Server connection.\n");
close(conn);
return;
}
/* Allocate a response structure and populate common fields */
- if ((NULL == (resp = malloc(sizeof(TID_RESP))))) {
+ if ((NULL == (resp = calloc(sizeof(TID_RESP), 1)))) {
fprintf(stderr, "Error allocating response structure.\n");
return;
}