www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Keck <pk...@coe.uga.edu>
Subject mod_userdir/1883: would like to use "dummy" passwd file for userdir determination
Date Fri, 27 Feb 1998 14:53:36 GMT

>Number:         1883
>Category:       mod_userdir
>Synopsis:       would like to use "dummy" passwd file for userdir determination
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          change-request
>Submitter-Id:   apache
>Arrival-Date:   Fri Feb 27 08:10:01 PST 1998
>Originator:     pkeck@coe.uga.edu
>Release:        1.2.5
SunOS xxxxx 5.5 Generic_103093-14 sun4m sparc SUNW,SPARCstation-5
I'm in the process of switching to Apache 1.2.5 from Netscape
Enterprise 3 on a Solaris 2.5 box.  I like Apache more so far (and by far),
but there was a nice thing about the NS server- it let you point at any
passwd format file with users' home dir info in it.  We have a lot of home
dirs NFS mounted from our primary "user" machine, and we would just put a
passwd entry for them in the dummy passwd file pointing at the mountpoint,

pkeck:**:102:102:Paul Keck:/mounteddir/pkeck:/usr/local/bin/false

This still works okay, but I have to put the dummy passwd entries in my real
passwd file.  Also, for people like me who actually log into the web server,
my home dir is over on the other machine now.  Not a big deal, but I like
how it was before.  :-)

I peeked at the source code and apache is doing a getpwnam call to get the
userdir, so it looks like I'm SOL unless I write my own getpwnam.  Has
anyone patched apache to look at a passwd file other than /etc/passwd?  No
use reinventing the wheel, and all that.

It looks like the only places in the source code that call a getpw* are:

http_main.c:      if ((ent = getpwuid(uid)) == NULL) {
http_main.c:     log_unixerr("getpwuid",NULL,"couldn't determine user name from uid", server_conf);
mod_include.c:    pw = getpwuid(r->finfo.st_uid);
mod_rewrite.c:        if ((pw = getpwnam(user)) != NULL) {
mod_rewrite.c:            if ((pw = getpwuid(r->finfo.st_uid)) != NULL) { 
mod_rewrite.c:                if ((pw = getpwuid(finfo.st_uid)) != NULL) { 
mod_userdir.c:  if((pw=getpwnam(w)))
util.c:    if(!(ent = getpwnam(name))) {
util_script.c:      if ((pw = getpwnam(username)) == NULL) {
util_script.c:          log_unixerr("getpwnam",username,"invalid username",r->server);
util_script.c:      if ((pw = getpwuid (r->server->server_uid)) == NULL) {
util_script.c:          log_unixerr("getpwuid", NULL, "invalid userid", r->server);

and there's only one in mod_userdir.c.  I was thinking that you could have
something like a_getpwnam called instead of getpwnam, a_getpwnam being a 
routine that checked a compile-time flag to see whether you had another 
passwd file defined.  If so, check it and return a struct passwd derived 
from there, otherwise use getpwnam.  It would be good to integrate it
with all the other code that calls getpw*, but I personally just need the 
userdir support.  As far as I can see the big benefit with using the real 
getpwnam is you can get info from NIS instead of a real file, but most
people using Apache probably have a real passwd file anyway.

Is anybody working on this?  My C abilities are pretty lame, so I don't 
want to attempt it if there's any chance someone else is working on it.

[In order for any reply to be added to the PR database, ]
[you need to include <apbugs@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]

View raw message