/*
* these should be done better; see the response codes in /lib/rfc/rfc2616 for
* more info on what should be included.
*/
#define UNAUTHED "You are not authorized to see this area.\n"
/*
* check for authorization for some parts of the server tree.
* the user name supplied with the authorization request is ignored;
* instead, we authenticate as the realm's user.
*
* authorization should be done before opening any files so that
* unauthorized users don't get to validate file names.
*
* returns 1 if authorized, 0 if unauthorized, -1 for io failure.
*/
int
authorize(HConnect *c, char *file)
{
char *p, *p0;
Hio *hout;
char *buf;
int i, n;
char *t[257];