Browse Source

[core] remove HANDLER_UNSET enum value

master
Glenn Strauss 7 months ago
parent
commit
fd0cc46833
  1. 1
      src/base_decls.h
  2. 13
      src/mod_auth.c
  3. 4
      src/mod_authn_gssapi.c

1
src/base_decls.h

@ -28,7 +28,6 @@ struct log_error_st;
typedef struct log_error_st log_error_st;
enum handler_t {
HANDLER_UNSET,
HANDLER_GO_ON,
HANDLER_FINISHED,
HANDLER_COMEBACK,

13
src/mod_auth.c

@ -733,7 +733,6 @@ static handler_t mod_auth_check_basic(request_st * const r, void *p_d, const str
const buffer *b = http_header_request_get(r, HTTP_HEADER_AUTHORIZATION, CONST_STR_LEN("Authorization"));
buffer *username;
char *pw;
handler_t rc = HANDLER_UNSET;
if (NULL == backend || NULL == backend->basic) {
if (NULL == backend)
@ -790,6 +789,7 @@ static handler_t mod_auth_check_basic(request_st * const r, void *p_d, const str
? &p->conf.auth_cache->sptree
: NULL;
http_auth_cache_entry *ae = NULL;
handler_t rc = HANDLER_ERROR;
int ndx = -1;
if (sptree) {
ndx = http_auth_cache_hash(require, CONST_BUF_LEN(username));
@ -804,7 +804,7 @@ static handler_t mod_auth_check_basic(request_st * const r, void *p_d, const str
ae = NULL;
}
if (NULL == ae) /* (HANDLER_UNSET == rc) */
if (NULL == ae)
rc = backend->basic(r, backend->p_d, require, username, pw);
switch (rc) {
@ -825,13 +825,13 @@ static handler_t mod_auth_check_basic(request_st * const r, void *p_d, const str
"password doesn't match for %s username: %s IP: %s",
r->uri.path.ptr, username->ptr, r->con->dst_addr_buf->ptr);
r->keep_alive = -1; /*(disable keep-alive if bad password)*/
rc = HANDLER_UNSET;
rc = mod_auth_send_401_unauthorized_basic(r, require->realm);
break;
}
safe_memclear(pw, pwlen);
buffer_free(username);
return (HANDLER_UNSET != rc) ? rc : mod_auth_send_401_unauthorized_basic(r, require->realm);
return rc;
}
@ -1422,13 +1422,12 @@ static handler_t mod_auth_check_digest(request_st * const r, void *p_d, const st
}
}
handler_t rc = HANDLER_UNSET;
plugin_data * const p = p_d;
splay_tree ** sptree = p->conf.auth_cache
? &p->conf.auth_cache->sptree
: NULL;
http_auth_cache_entry *ae = NULL;
handler_t rc = HANDLER_ERROR;
int ndx = -1;
if (sptree) {
ndx = http_auth_cache_hash(require, ai.username, ai.ulen);
@ -1445,7 +1444,7 @@ static handler_t mod_auth_check_digest(request_st * const r, void *p_d, const st
ae = NULL;
}
if (HANDLER_UNSET == rc)
if (NULL == ae)
rc = backend->digest(r, backend->p_d, &ai);
switch (rc) {

4
src/mod_authn_gssapi.c

@ -316,7 +316,7 @@ static handler_t mod_authn_gssapi_check_spnego(request_st * const r, plugin_data
gss_name_t client_name = GSS_C_NO_NAME;
buffer *sprinc;
handler_t rc = HANDLER_UNSET;
handler_t rc = HANDLER_ERROR;
buffer *t_in = buffer_init();
if (!buffer_append_base64_decode(t_in, realm_str, strlen(realm_str), BASE64_STANDARD)) {
@ -446,7 +446,7 @@ static handler_t mod_authn_gssapi_check_spnego(request_st * const r, plugin_data
if (token_out.length)
gss_release_buffer(&st_minor, &token_out);
return rc != HANDLER_UNSET ? rc : mod_authn_gssapi_send_401_unauthorized_negotiate(r);
return rc != HANDLER_ERROR ? rc : mod_authn_gssapi_send_401_unauthorized_negotiate(r);
}
static handler_t mod_authn_gssapi_check (request_st * const r, void *p_d, const struct http_auth_require_t * const require, const struct http_auth_backend_t * const backend)

Loading…
Cancel
Save