Index: include/mod_auth_sspi.h =================================================================== --- include/mod_auth_sspi.h (.../vendor/mod_auth_sspi/1.0.1) (revision 165) +++ include/mod_auth_sspi.h (.../trunk/mod_auth_sspi) (revision 165) @@ -84,6 +84,7 @@ unsigned int sspi_msie3hack; char *sspi_package; char *sspi_domain; + unsigned int sspi_omitdomain; } sspi_config_rec; typedef enum { Index: src/mod_auth_sspi.c =================================================================== --- src/mod_auth_sspi.c (.../vendor/mod_auth_sspi/1.0.1) (revision 165) +++ src/mod_auth_sspi.c (.../trunk/mod_auth_sspi) (revision 165) @@ -37,6 +37,9 @@ "set to the domain you want users authenticated against for " "cleartext authentication - if not specified, the local " "machine, then all trusted domains are checked"), + AP_INIT_TAKE1("SSPIOmitDomain", ap_set_flag_slot, + (void *) APR_XtOffsetOf(sspi_config_rec, sspi_omitdomain), OR_AUTHCFG, + "set to on if you want the usernames to have the domain prefix OMITTED, On = user Off = DOMAIN\\user"), AP_INIT_FLAG("SSPIBasicPreferred", ap_set_flag_slot, (void *) APR_XtOffsetOf(sspi_config_rec, sspi_basicpreferred), OR_AUTHCFG, "set to 'on' if you want basic authentication to be the " Index: src/authentication.c =================================================================== --- src/authentication.c (.../vendor/mod_auth_sspi/1.0.1) (revision 165) +++ src/authentication.c (.../trunk/mod_auth_sspi) (revision 165) @@ -313,7 +313,7 @@ } } -static int set_connection_details(request_rec *r, sspi_connection_rec *scr, const char *auth_type) +static int set_connection_details(request_rec *r, sspi_connection_rec *scr, const char *auth_type, int omitdomain) { SECURITY_STATUS ss; @@ -326,8 +326,16 @@ scr->package = apr_pstrdup(r->connection->pool, auth_type); } - if (scr->username != NULL) { - r->user = scr->username; + if (scr->username != NULL) { + if (omitdomain) { + char *s = strchr(scr->username, '\\'); + if (s) + r->user = s+1; + else + r->user = scr->username; + } else { + r->user = scr->username; + } r->ap_auth_type = scr->package; } else { return HTTP_INTERNAL_SERVER_ERROR; @@ -471,7 +479,7 @@ apr_pool_cleanup_register(r->pool, scr, cleanup_sspi_connection, apr_pool_cleanup_null); } - if (res = set_connection_details(r, scr, hdr.authtype == typeSSPI ? crec->sspi_package : "Basic")) { + if (res = set_connection_details(r, scr, hdr.authtype == typeSSPI ? crec->sspi_package : "Basic", crec->sspi_omitdomain)) { return res; } Index: src/interface.c =================================================================== --- src/interface.c (.../vendor/mod_auth_sspi/1.0.1) (revision 165) +++ src/interface.c (.../trunk/mod_auth_sspi) (revision 165) @@ -241,9 +241,10 @@ *decodelength = apr_base64_decode_len(data); decoded = apr_palloc(p, *decodelength); - if (decoded != NULL) { - if (apr_base64_decode_binary(decoded, data) > 0) { - decoded[(*decodelength) - 1] = '\0'; + if (decoded != NULL) { + *decodelength = apr_base64_decode_binary(decoded, data); + if (*decodelength > 0) { + decoded[(*decodelength)] = '\0'; return decoded; } } Index: bin/sspipkgs.exe =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: bin/mod_auth_sspi.so =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: Makefile =================================================================== --- Makefile (.../vendor/mod_auth_sspi/1.0.1) (revision 165) +++ Makefile (.../trunk/mod_auth_sspi) (revision 165) @@ -1,4 +1,4 @@ -APACHEDIR=..\httpd-2.0.40 +APACHEDIR=C:\Program Files\Apache Group\Apache2 MSVCDIR=\program files\microsoft visual studio\vc98 PLATSDKDIR=\program files\microsoft sdk @@ -13,8 +13,7 @@ CC=cl /nologo CFLAGS=/G6 /W3 /WX INCLUDES=/I include\ - /I "$(APACHEDIR)\include" /I "$(APACHEDIR)\srclib\apr\include"\ - /I "$(APACHEDIR)\srclib\apr-util\include" /I "$(APACHEDIR)\os\win32"\ + /I "$(APACHEDIR)\include"\ /I "$(PLATSDKDIR)\include" /I "$(MSVCDIR)\include" DEFINES=/D WIN32 @@ -22,9 +21,9 @@ LDFLAGS= LIBPATH=/LIBPATH:"\program files\microsoft sdk\lib"\ /LIBPATH:"\program files\microsoft visual studio\vc98\lib" -LIBRARIES=$(APACHEDIR)\Release\libhttpd.lib\ - $(APACHEDIR)\srclib\apr\Release\libapr.lib\ - $(APACHEDIR)\srclib\apr-util\Release\libaprutil.lib\ +LIBRARIES="$(APACHEDIR)\lib\libhttpd.lib"\ + "$(APACHEDIR)\lib\libapr.lib"\ + "$(APACHEDIR)\lib\libaprutil.lib"\ kernel32.lib advapi32.lib ole32.lib !if ($(DEBUG) != 0)