Bug 44076 - UserDir breaks in vhosts
Summary: UserDir breaks in vhosts
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_userdir (show other bugs)
Version: 2.2.4
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: FixedInTrunk
Depends on:
Blocks:
 
Reported: 2007-12-13 22:00 UTC by Bob
Modified: 2011-09-05 11:23 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bob 2007-12-13 22:00:51 UTC
In the default config for mod_userdir, I added "UserDir disabled" and then added
"UserDir enabled bob" to a vhost entry. I receive a 404 when attempting to
access http://mysite/~bob.

If I remove "UserDir disabled" (leaving the enabled line in the other file), it
still doesn't work. I was only able to get it to work by leaving it on for all
vhosts with no enabled line.

I just recently upgraded from 2.0.58 and it worked then. I completely blew away
my configuration and started over to be 2.2.4-compliant. But according to the
online documentation, I'm doing this correctly.

It might be note-worthy to mention that the machine is a member of an Active
Directory domain via Samba 3. The account is a local Unix user so that shouldn't
matter.

I diff'd the two version of mod_userdir.c and I see changes to two lines:

if (apr_uid_homepath_get(&homedir, w, r->pool) == APR_SUCCESS) {

and

if (apr_uid_get(&ugid->uid, &ugid->gid, username, r->pool) != APR_SUCCESS) {


This concerns me because both functions could break with Samba depending on what
type of voodoo apr is doing. Then again, when I removed winbind stuff from
nsswitch.conf, I still had a problem.

It might also help to mention that /home is a symlink to /data/home. I
temporarily changed this, also, and it didn't help.
Comment 1 Bob 2007-12-13 22:04:12 UTC
Actually, I just tried adding "UserDir disabled" and "UserDir enabled bob" to
the default userdir config file and it worked. So this appears to be limited to
vhosts.
Comment 2 Eric Covener 2010-12-03 22:50:45 UTC
fixed in trunk http://svn.apache.org/viewvc?rev=1042090&view=rev and proposed for backport
Comment 3 Eric Covener 2011-02-08 08:03:05 UTC
backported to 2.2.x in http://svn.apache.org/viewvc?rev=1068257&view=rev
Comment 4 Edward Z. Yang 2011-09-05 03:39:15 UTC
I'd like to remark that this bugfix causes behavior change. In particular, if I do the following:

UserDir disabled
<VirtualHost example.com>
  UserDir public_html
</VirtualHost>

In old versions of Apache, this would result in UserDir's being globally disabled, except for http://example.com/~bob. However, with this bugfix, http://example.com/~bob no longer works.

This version of the config does work:

UserDir disabled
<VirtualHost example.com>
  UserDir enabled
  UserDir public_html
</VirtualHost>

But it seems that this enabled stanza should be implicit when we pass a UserDir directory. Let me know if I should open a new bug.
Comment 5 Eric Covener 2011-09-05 11:20:54 UTC
> directory. Let me know if I should open a new bug.

reopening here, thanks for the report.
Comment 6 Eric Covener 2011-09-05 11:23:31 UTC
(In reply to comment #4)
> I'd like to remark that this bugfix causes behavior change. In particular, if I
> do the following:
> 
> UserDir disabled
> <VirtualHost example.com>
>   UserDir public_html
> </VirtualHost>
> 
> In old versions of Apache, this would result in UserDir's being globally
> disabled, except for http://example.com/~bob. However, with this bugfix,
> http://example.com/~bob no longer works.

I think this updated behavior must be the expectation though based on how disabled works

http://httpd.apache.org/docs/2.2/mod/mod_userdir.html