Changeset 481 for server/common
- Timestamp:
- Oct 15, 2007, 6:46:21 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/common/oursrc/httpdmods/mod_vhost_ldap.c
r479 r481 50 50 #define MIN_UID 100 51 51 #define MIN_GID 100 52 const char USERDIR[] = "web_scripts"; 52 53 53 54 module AP_MODULE_DECLARE_DATA vhost_ldap_module; … … 560 561 cgi = NULL; 561 562 563 #if 0 562 564 if (reqc->cgiroot) { 563 565 cgi = strstr(r->uri, "cgi-bin/"); … … 570 572 r->handler = "cgi-script"; 571 573 apr_table_setn(r->notes, "alias-forced-type", r->handler); 574 #endif 575 /* This is a quick, dirty hack. I should be shot for taking 6.170 576 * this term and being willing to write a quick, dirty hack. */ 577 578 if (strncmp(r->uri, "/~", 2) == 0) { 579 char *username; 580 uid_t uid = (uid_t)atoll(reqc->uid); 581 if (apr_uid_name_get(&username, uid, r->pool) != APR_SUCCESS) { 582 ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r, 583 "could not get username for uid %d", uid); 584 return DECLINED; 585 } 586 if (strncmp(r->uri + 2, username, strlen(username)) == 0 && 587 r->uri[2 + strlen(username)] == '/') { 588 char *homedir; 589 if (apr_uid_homepath_get(&homedir, username, r->pool) != APR_SUCCESS) { 590 ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r, 591 "could not get home directory for user %s", username); 592 return DECLINED; 593 } 594 r->filename = apr_pstrcat(r->pool, homedir, "/", USERDIR, r->uri + 2 + strlen(username), NULL); 595 } 572 596 } else if (r->uri[0] == '/') { 573 597 r->filename = apr_pstrcat (r->pool, reqc->docroot, r->uri, NULL);
Note: See TracChangeset
for help on using the changeset viewer.