You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by David Robinson <dr...@ast.cam.ac.uk> on 1995/10/27 15:18:00 UTC

UserDir bug

>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;