httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@ast.cam.ac.uk (David Robinson)
Subject UserDir bug
Date Fri, 27 Oct 1995 14:18:00 GMT
>From ciwsu
>From: rd@tarpit.rd.gencon.com (Bob Thrush)
>  I would like to allow web pages from user directories in the main
>web domain but disable them in virtual domains hosted by the same
>server.
>
>  srm.conf contains:
>
>UserDir web-docs
>
>  httpd.conf contains:
>
><VirtualHost www.vdomain.com>
>DocumentRoot /provider/WWW/groups/vdomain.com
>ServerName www.vdomain.com
>ErrorLog /provider/WWW/groups/vdomain.com/logs/error_log
>TransferLog /provider/WWW/groups/vdomain.com/logs/access_log
>UserDir disabled
></VirtualHost>
>
>  I thought the above would disable the UserDir feature in the virtual
>domain; however, it does not.  Is this a bug?  A feature?  Or (more
>likely), have I overlooked some additional required configuration item?

This is a bug; mod_userdir was using a value of NULL in the configuration
array to indicate UserDir disabled, but merge_server_config takes NULL
to indicate an unset parameter that should inherit its value from some
default, such as the value for the main server.

A patch follows.

 David.

35.userdir.0.8.15.patch
  Subject: Fix UserDir in VirtualHost sections
  Affects: mod_alias.c
  ChangeLog: Don't use NULL for the userdir to indicate 'disabled'; NULL means
             the value is unset and that a default value should be chosen.

*** mod_userdir.c.orig	Tue Oct 10 23:00:34 1995
--- mod_userdir.c	Fri Oct 27 10:52:20 1995
***************
*** 81,88 ****
  {
      void *server_conf = cmd->server->module_config;
      
-     if (!strcasecmp (arg, "disabled")) arg = NULL;
-     
      set_module_config (server_conf, &userdir_module, pstrdup (cmd->pool, arg));
      return NULL;
  }
--- 81,86 ----
***************
*** 99,105 ****
      char *userdir = (char *)get_module_config(server_conf, &userdir_module);
      char *name = r->uri;
      
!     if (userdir && (name[0] == '/') && (name[1] == '~'))
      {
          struct passwd *pw;
  	char *w, *dname;
--- 97,104 ----
      char *userdir = (char *)get_module_config(server_conf, &userdir_module);
      char *name = r->uri;
      
!     if (userdir != NULL && strcasecmp(userdir, "disabled") != 0 &&
! 	name[0] == '/' && name[1] == '~')
      {
          struct passwd *pw;
  	char *w, *dname;

Mime
View raw message