From: William A. Rowe Jr Date: Fri, 13 Sep 2002 21:55:31 +0000 (+0000) Subject: A quick-n-dirty hack. Expose the auth_provider api from mod_auth_basic X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1019a93de45ede665acee348e2754d45765e85d0;p=apache A quick-n-dirty hack. Expose the auth_provider api from mod_auth_basic alone, on Win32 only. Requires mod_auth_basic be loaded prior to using mod_auth_digest or any other mod_authn/z modules. Win32 builds again. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96794 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/Apache.dsw b/Apache.dsw index a3d51a24ac..593239be4a 100644 --- a/Apache.dsw +++ b/Apache.dsw @@ -66,9 +66,6 @@ Package=<4> Project_Dep_Name mod_asis End Project Dependency Begin Project Dependency - Project_Dep_Name mod_auth_basic - End Project Dependency - Begin Project Dependency Project_Dep_Name mod_auth_digest End Project Dependency Begin Project Dependency @@ -605,6 +602,9 @@ Package=<4> Begin Project Dependency Project_Dep_Name libhttpd End Project Dependency + Begin Project Dependency + Project_Dep_Name mod_auth_basic + End Project Dependency }}} ############################################################################### @@ -626,6 +626,9 @@ Package=<4> Begin Project Dependency Project_Dep_Name libhttpd End Project Dependency + Begin Project Dependency + Project_Dep_Name mod_auth_basic + End Project Dependency }}} ############################################################################### @@ -647,6 +650,9 @@ Package=<4> Begin Project Dependency Project_Dep_Name libhttpd End Project Dependency + Begin Project Dependency + Project_Dep_Name mod_auth_basic + End Project Dependency }}} ############################################################################### @@ -668,6 +674,9 @@ Package=<4> Begin Project Dependency Project_Dep_Name libhttpd End Project Dependency + Begin Project Dependency + Project_Dep_Name mod_auth_basic + End Project Dependency }}} ############################################################################### @@ -689,6 +698,9 @@ Package=<4> Begin Project Dependency Project_Dep_Name libhttpd End Project Dependency + Begin Project Dependency + Project_Dep_Name mod_auth_basic + End Project Dependency }}} ############################################################################### @@ -710,6 +722,9 @@ Package=<4> Begin Project Dependency Project_Dep_Name libhttpd End Project Dependency + Begin Project Dependency + Project_Dep_Name mod_auth_basic + End Project Dependency }}} ############################################################################### @@ -731,6 +746,9 @@ Package=<4> Begin Project Dependency Project_Dep_Name libhttpd End Project Dependency + Begin Project Dependency + Project_Dep_Name mod_auth_basic + End Project Dependency }}} ############################################################################### @@ -752,6 +770,9 @@ Package=<4> Begin Project Dependency Project_Dep_Name libhttpd End Project Dependency + Begin Project Dependency + Project_Dep_Name mod_auth_basic + End Project Dependency }}} ############################################################################### @@ -773,6 +794,9 @@ Package=<4> Begin Project Dependency Project_Dep_Name libhttpd End Project Dependency + Begin Project Dependency + Project_Dep_Name mod_auth_basic + End Project Dependency }}} ############################################################################### @@ -794,6 +818,9 @@ Package=<4> Begin Project Dependency Project_Dep_Name libhttpd End Project Dependency + Begin Project Dependency + Project_Dep_Name mod_auth_basic + End Project Dependency }}} ############################################################################### diff --git a/Makefile.win b/Makefile.win index 27554df21a..00633710b4 100644 --- a/Makefile.win +++ b/Makefile.win @@ -420,7 +420,6 @@ _install: copy srclib\apr\$(LONG)\libapr.pdb "$(INSTDIR)\bin" <.y copy srclib\apr-iconv\$(LONG)\libapriconv.pdb "$(INSTDIR)\bin" <.y copy srclib\apr-util\$(LONG)\libaprutil.pdb "$(INSTDIR)\bin" <.y - copy modules\aaa\$(LONG)\mod_access.pdb "$(INSTDIR)\modules" <.y copy modules\aaa\$(LONG)\mod_auth_basic.pdb "$(INSTDIR)\modules" <.y copy modules\aaa\$(LONG)\mod_auth_digest.pdb "$(INSTDIR)\modules" <.y copy modules\aaa\$(LONG)\mod_authn_anon.pdb "$(INSTDIR)\modules" <.y diff --git a/modules/aaa/auth_provider.c b/modules/aaa/auth_provider.c index 5f08483875..25260b5601 100644 --- a/modules/aaa/auth_provider.c +++ b/modules/aaa/auth_provider.c @@ -73,7 +73,7 @@ static apr_status_t authz_cleanup_providers(void *ctx) return APR_SUCCESS; } -AP_DECLARE(void) authn_register_provider(apr_pool_t *p, const char *name, +AAA_DECLARE(void) authn_register_provider(apr_pool_t *p, const char *name, const authn_provider *provider) { if (authn_repos_providers == NULL) { @@ -86,7 +86,7 @@ AP_DECLARE(void) authn_register_provider(apr_pool_t *p, const char *name, apr_hash_set(authn_repos_providers, name, APR_HASH_KEY_STRING, provider); } -AP_DECLARE(const authn_provider *) authn_lookup_provider(const char *name) +AAA_DECLARE(const authn_provider *) authn_lookup_provider(const char *name) { /* Better watch out against no registered providers */ if (authn_repos_providers == NULL) { @@ -96,7 +96,7 @@ AP_DECLARE(const authn_provider *) authn_lookup_provider(const char *name) return apr_hash_get(authn_repos_providers, name, APR_HASH_KEY_STRING); } -AP_DECLARE(void) authz_register_provider(apr_pool_t *p, const char *name, +AAA_DECLARE(void) authz_register_provider(apr_pool_t *p, const char *name, const authz_provider *provider) { if (authz_repos_providers == NULL) { @@ -109,7 +109,7 @@ AP_DECLARE(void) authz_register_provider(apr_pool_t *p, const char *name, apr_hash_set(authz_repos_providers, name, APR_HASH_KEY_STRING, provider); } -AP_DECLARE(const authz_provider *) authz_lookup_provider(const char *name) +AAA_DECLARE(const authz_provider *) authz_lookup_provider(const char *name) { /* Better watch out against no registered providers */ if (authz_repos_providers == NULL) { diff --git a/modules/aaa/mod_auth.h b/modules/aaa/mod_auth.h index 7c167438e9..f7fe064c1f 100644 --- a/modules/aaa/mod_auth.h +++ b/modules/aaa/mod_auth.h @@ -65,6 +65,23 @@ extern "C" { #endif +/* Create a set of AAA_DECLARE(type) and AAA_DECLARE_DATA with + * appropriate export and import tags for the platform + */ +#if !defined(WIN32) +#define AAA_DECLARE(type) type +#define AAA_DECLARE_DATA +#elif defined(AAA_DECLARE_STATIC) +#define AAA_DECLARE(type) type __stdcall +#define AAA_DECLARE_DATA +#elif defined(AAA_DECLARE_EXPORT) +#define AAA_DECLARE(type) __declspec(dllexport) type __stdcall +#define AAA_DECLARE_DATA __declspec(dllexport) +#else +#define AAA_DECLARE(type) __declspec(dllimport) type __stdcall +#define AAA_DECLARE_DATA __declspec(dllimport) +#endif + #define AUTHN_DEFAULT_PROVIDER "file" typedef enum { @@ -89,18 +106,18 @@ typedef struct { const char *realm, char **rethash); } authn_provider; -AP_DECLARE(void) authn_register_provider(apr_pool_t *p, const char *name, +AAA_DECLARE(void) authn_register_provider(apr_pool_t *p, const char *name, const authn_provider *provider); -AP_DECLARE(const authn_provider *) authn_lookup_provider(const char *name); +AAA_DECLARE(const authn_provider *) authn_lookup_provider(const char *name); typedef struct { /* For a given user, return a hash of all groups the user belongs to. */ apr_hash_t * (*get_user_groups)(request_rec *r, const char *user); } authz_provider; -AP_DECLARE(void) authz_register_provider(apr_pool_t *p, const char *name, +AAA_DECLARE(void) authz_register_provider(apr_pool_t *p, const char *name, const authz_provider *provider); -AP_DECLARE(const authz_provider *) authz_lookup_provider(const char *name); +AAA_DECLARE(const authz_provider *) authz_lookup_provider(const char *name); #ifdef __cplusplus } #endif diff --git a/modules/aaa/mod_auth_basic.dsp b/modules/aaa/mod_auth_basic.dsp index 5f7ebd1048..fe779a95ba 100644 --- a/modules/aaa/mod_auth_basic.dsp +++ b/modules/aaa/mod_auth_basic.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_auth_basic" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "AAA_DECLARE_EXPORT" /Fd"Release\mod_auth_basic" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -69,7 +69,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_auth_basic" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /I "../../srclib/apr/include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "AAA_DECLARE_EXPORT" /Fd"Debug\mod_auth_basic" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" diff --git a/modules/aaa/mod_auth_digest.dsp b/modules/aaa/mod_auth_digest.dsp index 3d61eb98de..c673ce5e32 100644 --- a/modules/aaa/mod_auth_digest.dsp +++ b/modules/aaa/mod_auth_digest.dsp @@ -93,10 +93,6 @@ SOURCE=.\mod_auth_digest.c # End Source File # Begin Source File -SOURCE=.\auth_provider.c -# End Source File -# Begin Source File - SOURCE=.\mod_auth_digest.rc # End Source File # Begin Source File