Mailing List Archive

I guess you could call this my "suggestion"... (fwd)
No ack sent

Forwarded message:
> From eric@hal.sonoma.net Mon Oct 16 14:43:21 1995
> From: Eric Eisenhart <eric@hal.sonoma.net>
> Message-Id: <199510162143.OAA23041@hal.sonoma.net>
> Subject: I guess you could call this my "suggestion"...
> To: apache-bugs@mail.apache.org
> Date: Mon, 16 Oct 1995 14:43:15 -0700 (PDT)
> X-Mailer: ELM [version 2.4 PL23]
> MIME-Version: 1.0
> Content-Type: text/plain; charset=ISO-8859-1
> Content-Transfer-Encoding: 8bit
> Content-Length: 2443
>
> This is my "suggestion" about how the userdir module should operate.
> Specifically, I think it should operate such that if the UserDir starts with
> a / (ie, is an absolute path), then a ~user should reference that path,
> followed by user.
>
> ie, if srm.conf has:
> UserDir public_html
> it does the standard
> ~user -> ~user/public_html
> but if srm.conf has:
> UserDir /home/WWW_pages
> then
> ~user -> /home/WWW_pages/user
>
> Here's the more precise version of my suggestion:
>
> *** mod_userdir.c.old Sun Oct 15 01:19:27 1995
> --- mod_userdir.c Mon Oct 16 00:15:45 1995
> ***************
> *** 105,129 ****
>
> if (userdir && (name[0] == '/') && (name[1] == '~'))
> {
> ! struct passwd *pw;
> ! char *w, *dname;
>
> ! dname = name + 2;
> ! w = getword(r->pool, &dname, '/');
> ! if(!(pw=getpwnam(w)))
> return NOT_FOUND;
>
> ! /* The 'dname' funny business involves backing it up to capture
> ! * the '/' delimiting the "/~user" part from the rest of the URL,
> ! * in case there was one (the case where there wasn't being just
> ! * "GET /~user HTTP/1.0", for which we don't want to tack on a
> ! * '/' onto the filename).
> ! */
>
> ! if (dname[-1] == '/') --dname;
> ! r->filename = pstrcat (r->pool, pw->pw_dir, "/", userdir, dname, NULL);
>
> ! return OK;
> }
>
> return DECLINED;
> --- 105,144 ----
>
> if (userdir && (name[0] == '/') && (name[1] == '~'))
> {
> ! if (userdir[0] != '/')
> ! {
> ! struct passwd *pw;
> ! char *w, *dname;
>
> ! dname = name + 2;
> ! w = getword(r->pool, &dname, '/');
> ! if(!(pw=getpwnam(w)))
> return NOT_FOUND;
>
> ! /* The 'dname' funny business involves backing it up to capture
> ! * the '/' delimiting the "/~user" part from the rest of the URL,
> ! * in case there was one (the case where there wasn't being just
> ! * "GET /~user HTTP/1.0", for which we don't want to tack on a
> ! * '/' onto the filename).
> ! */
>
> ! if (dname[-1] == '/') --dname;
> ! r->filename = pstrcat (r->pool, pw->pw_dir, "/", userdir, dname, NULL);
> !
> ! return OK;
> ! }
> ! else
> ! {
> ! char *w, *dname;
> !
> ! dname = name + 2;
> ! w = getword(r->pool, &dname, '/');
>
> ! if (dname[-1] == '/') --dname;
> ! r->filename = pstrcat (r->pool, userdir, "/", w, dname, NULL);
> !
> ! return OK;
> ! }
> }
>
> return DECLINED;
>