Browse Source

[mod_auth*] rename http_auth.* -> mod_auth_api.*

rename http_auth.[ch] -> mod_auth_api.[ch]
master
Glenn Strauss 5 months ago
parent
commit
3538f8f2a4
  1. 2
      src/CMakeLists.txt
  2. 6
      src/Makefile.am
  3. 2
      src/SConscript
  4. 2
      src/configfile.c
  5. 2
      src/meson.build
  6. 13
      src/mod_auth.c
  7. 4
      src/mod_auth_api.c
  8. 11
      src/mod_auth_api.h
  9. 6
      src/mod_authn_dbi.c
  10. 13
      src/mod_authn_file.c
  11. 15
      src/mod_authn_gssapi.c
  12. 8
      src/mod_authn_ldap.c
  13. 12
      src/mod_authn_mysql.c
  14. 8
      src/mod_authn_pam.c
  15. 10
      src/mod_authn_sasl.c
  16. 2
      src/mod_gnutls.c
  17. 2
      src/mod_mbedtls.c
  18. 2
      src/mod_nss.c
  19. 2
      src/mod_openssl.c
  20. 2
      src/mod_wolfssl.c

2
src/CMakeLists.txt

@ -810,7 +810,7 @@ add_and_install_library(mod_access mod_access.c)
add_and_install_library(mod_accesslog mod_accesslog.c)
add_and_install_library(mod_ajp13 mod_ajp13.c)
add_and_install_library(mod_alias mod_alias.c)
add_and_install_library(mod_auth "mod_auth.c;http_auth.c")
add_and_install_library(mod_auth "mod_auth.c;mod_auth_api.c")
add_and_install_library(mod_authn_file "mod_authn_file.c")
if(NOT WIN32)
add_and_install_library(mod_cgi mod_cgi.c)

6
src/Makefile.am

@ -332,7 +332,7 @@ mod_deflate_la_LDFLAGS = $(BROTLI_CFLAGS) $(common_module_ldflags)
mod_deflate_la_LIBADD = $(Z_LIB) $(ZSTD_LIB) $(BZ_LIB) $(BROTLI_LIBS) $(common_libadd)
lib_LTLIBRARIES += mod_auth.la
mod_auth_la_SOURCES = mod_auth.c http_auth.c
mod_auth_la_SOURCES = mod_auth.c mod_auth_api.c
mod_auth_la_LDFLAGS = $(common_module_ldflags)
mod_auth_la_LIBADD = $(CRYPTO_LIB) $(common_libadd)
@ -463,7 +463,7 @@ hdr = base64.h buffer.h burl.h network.h log.h http_kv.h keyvalue.h \
algo_hmac.h \
algo_md.h algo_md5.h algo_sha1.h algo_splaytree.h algo_xxhash.h \
ck.h \
http_auth.h http_cgi.h http_date.h \
http_cgi.h http_date.h \
http_header.h http_range.h http_vhostdb.h \
fdevent.h gw_backend.h connections.h base.h base_decls.h stat_cache.h \
plugin.h plugin_config.h \
@ -477,6 +477,7 @@ hdr = base64.h buffer.h burl.h network.h log.h http_kv.h keyvalue.h \
sys-endian.h sys-mmap.h sys-socket.h sys-strings.h sys-time.h \
mod_cml.h mod_cml_funcs.h \
sock_addr.h status_counter.h \
mod_auth_api.h \
mod_magnet_cache.h \
ls-hpack/lshpack.h \
ls-hpack/lsxpack_header.h \
@ -498,6 +499,7 @@ lighttpd_SOURCES = \
mod_ajp13.c \
mod_alias.c \
mod_auth.c \
mod_auth_api.c \
mod_authn_file.c \
mod_cgi.c \
mod_deflate.c \

2
src/SConscript

@ -101,7 +101,7 @@ modules = {
'mod_accesslog' : { 'src' : [ 'mod_accesslog.c' ] },
'mod_ajp13' : { 'src' : [ 'mod_ajp13.c' ] },
'mod_alias' : { 'src' : [ 'mod_alias.c' ] },
'mod_auth' : { 'src' : [ 'mod_auth.c', 'http_auth.c' ], 'lib' : [ env['LIBCRYPTO'] ] },
'mod_auth' : { 'src' : [ 'mod_auth.c', 'mod_auth_api.c' ], 'lib' : [ env['LIBCRYPTO'] ] },
'mod_authn_file' : { 'src' : [ 'mod_authn_file.c' ], 'lib' : [ env['LIBCRYPT'], env['LIBCRYPTO'] ] },
'mod_cgi' : { 'src' : [ 'mod_cgi.c' ] },
'mod_deflate' : { 'src' : [ 'mod_deflate.c' ], 'lib' : [ env['LIBZ'], env['LIBZSTD'], env['LIBBZ2'], env['LIBBROTLI'], 'm' ] },

2
src/configfile.c

@ -425,7 +425,7 @@ static void config_compat_module_load (server *srv) {
#endif
}
/* mod_auth.c,http_auth.c auth backends were split into separate modules
/* mod_auth.c,mod_auth_api.c auth backends were split into separate modules
* Automatically load auth backend modules for compatibility with
* existing lighttpd 1.4.x configs */
if (contains_mod_auth) {

2
src/meson.build

@ -984,7 +984,7 @@ modules = [
[ 'mod_accesslog', [ 'mod_accesslog.c' ] ],
[ 'mod_ajp13', [ 'mod_ajp13.c' ] ],
[ 'mod_alias', [ 'mod_alias.c' ] ],
[ 'mod_auth', [ 'mod_auth.c', 'http_auth.c' ], [ libcrypto ] ],
[ 'mod_auth', [ 'mod_auth.c', 'mod_auth_api.c' ], [ libcrypto ] ],
[ 'mod_authn_file', [ 'mod_authn_file.c' ], [ libcrypt, libcrypto ] ],
[ 'mod_deflate', [ 'mod_deflate.c' ], libbz2 + libz + libzstd + libbrotli ],
[ 'mod_dirlisting', [ 'mod_dirlisting.c' ] ],

13
src/mod_auth.c

@ -1,18 +1,25 @@
/*
* http_auth - HTTP authentication and authorization
*
* Largely-rewritten from original
* Copyright(c) 2016,2021 Glenn Strauss gstrauss()gluelogic.com All rights reserved
* License: BSD 3-clause (same as lighttpd)
*/
#include "first.h"
#include <stdlib.h>
#include <string.h>
#include "mod_auth_api.h"
#include "sys-crypto-md.h" /* USE_LIB_CRYPTO */
#include "base.h"
#include "ck.h"
#include "plugin.h"
#include "plugin_config.h"
#include "http_auth.h"
#include "http_header.h"
#include "log.h"
#include "algo_splaytree.h"
#include "plugin.h"
#include "plugin_config.h"
/**
* auth framework

4
src/http_auth.c → src/mod_auth_api.c

@ -1,5 +1,5 @@
/*
* http_auth - HTTP Auth backend registration, low-level shared funcs
* mod_auth_api - HTTP Auth backend registration, low-level shared funcs
*
* Fully-rewritten from original
* Copyright(c) 2016 Glenn Strauss gstrauss()gluelogic.com All rights reserved
@ -7,7 +7,7 @@
*/
#include "first.h"
#include "http_auth.h"
#include "mod_auth_api.h"
#include "http_header.h"
#include <stdlib.h>

11
src/http_auth.h → src/mod_auth_api.h

@ -1,5 +1,12 @@
#ifndef _HTTP_AUTH_H_
#define _HTTP_AUTH_H_
/*
* mod_auth_api - HTTP auth backend registration, low-level shared funcs
*
* Fully-rewritten from original
* Copyright(c) 2016 Glenn Strauss gstrauss()gluelogic.com All rights reserved
* License: BSD 3-clause (same as lighttpd)
*/
#ifndef INCLUDED_MOD_AUTH_API_H
#define INCLUDED_MOD_AUTH_API_H
#include "first.h"
#include "base_decls.h"

6
src/mod_authn_dbi.c

@ -33,15 +33,15 @@
#include <crypt.h>
#endif
#include <dbi/dbi.h>
#include <string.h>
#include <stdlib.h>
#include <dbi/dbi.h>
#include "mod_auth_api.h"
#include "sys-crypto-md.h"
#include "base.h"
#include "ck.h"
#include "http_auth.h"
#include "fdevent.h"
#include "log.h"
#include "plugin.h"

13
src/mod_authn_file.c

@ -16,19 +16,18 @@
# define HAVE_CRYPT
#endif
#include <stdlib.h>
#include <string.h>
#include "mod_auth_api.h"
#include "sys-crypto-md.h" /* USE_LIB_CRYPTO */
#include "base.h"
#include "base64.h"
#include "ck.h"
#include "plugin.h"
#include "fdevent.h"
#include "http_auth.h"
#include "log.h"
#include "base64.h"
#include <stdlib.h>
#include <string.h>
#include "plugin.h"
/*
* htdigest, htpasswd, plain auth backends

15
src/mod_authn_gssapi.c

@ -20,21 +20,20 @@
* TODO: attempt async?
*/
#include "plugin.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <krb5.h>
#include <gssapi.h>
#include <gssapi/gssapi_krb5.h>
#include "http_auth.h"
#include "http_header.h"
#include "mod_auth_api.h"
#include "base.h"
#include "log.h"
#include "base64.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "http_header.h"
#include "log.h"
#include "plugin.h"
typedef struct {
const buffer *auth_gssapi_keytab;

8
src/mod_authn_ldap.c

@ -7,16 +7,16 @@
*/
#include "first.h"
#include <stdlib.h>
#include <string.h>
#include <ldap.h>
#include "mod_auth_api.h"
#include "base.h"
#include "http_auth.h"
#include "log.h"
#include "plugin.h"
#include <stdlib.h>
#include <string.h>
typedef struct {
LDAP *ldap;
log_error_st *errh;

12
src/mod_authn_mysql.c

@ -27,19 +27,19 @@
#include <crypt.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <mysql.h>
#include "mod_auth_api.h"
#include "sys-crypto-md.h"
#include "base.h"
#include "ck.h"
#include "http_auth.h"
#include "log.h"
#include "plugin.h"
#include <stdlib.h>
#include <string.h>
#include "sys-crypto-md.h"
typedef struct {
int auth_mysql_port;
const char *auth_mysql_host;

8
src/mod_authn_pam.c

@ -17,16 +17,16 @@
* - database query is synchronous and blocks waiting for response
*/
#include <stdlib.h>
#include <string.h>
#include <security/pam_appl.h>
#include "mod_auth_api.h"
#include "base.h"
#include "http_auth.h"
#include "log.h"
#include "plugin.h"
#include <stdlib.h>
#include <string.h>
typedef struct {
const char *service;
} plugin_config;

10
src/mod_authn_sasl.c

@ -17,17 +17,17 @@
* - database query is synchronous and blocks waiting for response
*/
#include <sys/utsname.h>
#include <stdlib.h>
#include <string.h>
#include <sasl/sasl.h>
#include "mod_auth_api.h"
#include "base.h"
#include "http_auth.h"
#include "log.h"
#include "plugin.h"
#include <sys/utsname.h>
#include <stdlib.h>
#include <string.h>
typedef struct {
const char *service;
const char *fqdn;

2
src/mod_gnutls.c

@ -2861,7 +2861,7 @@ https_add_ssl_client_entries (request_st * const r, handler_ctx * const hctx)
*/
const buffer *varname = hctx->conf.ssl_verifyclient_username;
vb = http_header_env_get(r, CONST_BUF_LEN(varname));
if (vb) { /* same as http_auth.c:http_auth_setenv() */
if (vb) { /* same as mod_auth_api.c:http_auth_setenv() */
http_header_env_set(r,
CONST_STR_LEN("REMOTE_USER"),
CONST_BUF_LEN(vb));

2
src/mod_mbedtls.c

@ -2495,7 +2495,7 @@ https_add_ssl_client_entries (request_st * const r, handler_ctx * const hctx)
*/
const buffer *varname = hctx->conf.ssl_verifyclient_username;
vb = http_header_env_get(r, CONST_BUF_LEN(varname));
if (vb) { /* same as http_auth.c:http_auth_setenv() */
if (vb) { /* same as mod_auth_api.c:http_auth_setenv() */
http_header_env_set(r,
CONST_STR_LEN("REMOTE_USER"),
CONST_BUF_LEN(vb));

2
src/mod_nss.c

@ -2608,7 +2608,7 @@ https_add_ssl_client_entries (request_st * const r, handler_ctx * const hctx)
*/
const buffer *varname = hctx->conf.ssl_verifyclient_username;
vb = http_header_env_get(r, CONST_BUF_LEN(varname));
if (vb) { /* same as http_auth.c:http_auth_setenv() */
if (vb) { /* same as mod_auth_api.c:http_auth_setenv() */
http_header_env_set(r,
CONST_STR_LEN("REMOTE_USER"),
CONST_BUF_LEN(vb));

2
src/mod_openssl.c

@ -3513,7 +3513,7 @@ https_add_ssl_client_entries (request_st * const r, handler_ctx * const hctx)
*/
const buffer *varname = hctx->conf.ssl_verifyclient_username;
vb = http_header_env_get(r, CONST_BUF_LEN(varname));
if (vb) { /* same as http_auth.c:http_auth_setenv() */
if (vb) { /* same as mod_auth_api.c:http_auth_setenv() */
http_header_env_set(r,
CONST_STR_LEN("REMOTE_USER"),
CONST_BUF_LEN(vb));

2
src/mod_wolfssl.c

@ -3283,7 +3283,7 @@ https_add_ssl_client_entries (request_st * const r, handler_ctx * const hctx)
*/
const buffer *varname = hctx->conf.ssl_verifyclient_username;
vb = http_header_env_get(r, CONST_BUF_LEN(varname));
if (vb) { /* same as http_auth.c:http_auth_setenv() */
if (vb) { /* same as mod_auth_api.c:http_auth_setenv() */
http_header_env_set(r,
CONST_STR_LEN("REMOTE_USER"),
CONST_BUF_LEN(vb));

Loading…
Cancel
Save