- Timestamp:
- Aug 26, 2010, 4:28:41 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/common/oursrc/httpdmods/mod_vhost_ldap.c
r1589 r1603 436 436 static int mod_vhost_ldap_translate_name(request_rec *r) 437 437 { 438 server_rec *server; 439 const char *error; 438 440 mod_vhost_ldap_request_t *reqc; 439 441 int failures = 0; … … 442 444 mod_vhost_ldap_config_t *conf = 443 445 (mod_vhost_ldap_config_t *)ap_get_module_config(r->server->module_config, &vhost_ldap_module); 444 core_server_config *core = 445 (core_server_config *)ap_get_module_config(r->server->module_config, &core_module); 446 core_server_config *core; 446 447 util_ldap_connection_t *ldc = NULL; 447 448 int result = 0; … … 455 456 struct berval hostnamebv, shostnamebv; 456 457 int ret = DECLINED; 458 459 if ((error = ap_init_virtual_host(r->pool, "", r->server, &server)) != NULL) { 460 ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r, 461 "[mod_vhost_ldap.c]: Could not initialize a new VirtualHost: %s", 462 error); 463 return HTTP_INTERNAL_SERVER_ERROR; 464 } 465 466 core = core_module.create_server_config(r->pool, server); 467 ap_set_module_config(server->module_config, &core_module, core); 457 468 458 469 reqc = … … 659 670 } 660 671 661 if ((r->server = apr_pmemdup(r->pool, r->server, sizeof(*r->server))) == NULL) { 662 ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r, 663 "[mod_vhost_ldap.c] translate: " 664 "translate failed; Unable to copy r->server structure"); 665 return HTTP_INTERNAL_SERVER_ERROR; 666 } 667 668 r->server->server_hostname = reqc->name; 672 server->server_hostname = reqc->name; 669 673 670 674 if (reqc->admin) { 671 r->server->server_admin = reqc->admin; 672 } 673 674 if ((r->server->module_config = apr_pmemdup(r->pool, r->server->module_config, 675 sizeof(void *) * 676 (total_modules + DYNAMIC_MODULE_LIMIT))) == NULL) { 677 ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r, 678 "[mod_vhost_ldap.c] translate: " 679 "translate failed; Unable to copy r->server->module_config structure"); 680 return HTTP_INTERNAL_SERVER_ERROR; 681 } 682 683 if ((core = apr_pmemdup(r->pool, core, sizeof(*core))) == NULL) { 684 ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r, 685 "[mod_vhost_ldap.c] translate: " 686 "translate failed; Unable to copy r->core structure"); 687 return HTTP_INTERNAL_SERVER_ERROR; 688 } 689 ap_set_module_config(r->server->module_config, &core_module, core); 675 server->server_admin = reqc->admin; 676 } 690 677 691 678 /* Stolen from server/core.c */ … … 711 698 core->ap_document_root = reqc->docroot; 712 699 } 700 701 ap_fixup_virtual_host(r->pool, r->server, server); 702 r->server = server; 713 703 714 704 /* Hack to allow post-processing by other modules (mod_rewrite, mod_alias) */
Note: See TracChangeset
for help on using the changeset viewer.