home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-11-16 | 38.1 KB | 1,348 lines |
- *** ../../../../2.13/WWW/Library/Implementation/CommonMakefile Mon Oct 11 14:46:29 1993
- --- CommonMakefile Tue Nov 16 15:48:57 1993
- ***************
- *** 45,51 ****
-
- WC = $(WWW)/Library
- CMN = $(WWW)/Library/Implementation/
- !
- # Where shall we put the objects and built library?
-
- LOB = $(WTMP)/Library/$(WWW_MACH)
- --- 45,51 ----
-
- WC = $(WWW)/Library
- CMN = $(WWW)/Library/Implementation/
- ! VMS = $(CMN)vms
- # Where shall we put the objects and built library?
-
- LOB = $(WTMP)/Library/$(WWW_MACH)
- ***************
- *** 121,127 ****
- SOURCES = $(CFILES) $(HFILES) $(CMN)Version.make \
- $(CMN)CommonMakefile $(CMN)Makefile \
- $(WWW)/README.txt $(WWW)/Copyright.txt $(WWW)/BUILD $(WWW)/Makefile
- ! SPECIFIC = $(WWW)/All/*/Makefile.include $(WWW)/All/Implementation/Makefile*
-
-
- # Library
- --- 121,133 ----
- SOURCES = $(CFILES) $(HFILES) $(CMN)Version.make \
- $(CMN)CommonMakefile $(CMN)Makefile \
- $(WWW)/README.txt $(WWW)/Copyright.txt $(WWW)/BUILD $(WWW)/Makefile
- ! SPECIFIC = $(WWW)/All/*/Makefile.include $(WWW)/All/Implementation/Makefile* \
- ! $(VMS)/descrip.mms $(VMS)/build_multinet.com \
- ! $(VMS)/COPYING.LIB $(VMS)/setup.com $(VMS)/multinet.opt \
- ! $(VMS)/patchlevel.h $(VMS)/ufc-crypt.h \
- ! $(VMS)/crypt.c $(VMS)/crypt_util.c \
- ! $(VMS)/getline.c $(VMS)/getpass.c \
- ! $(VMS)/HTVMSUtils.h $(VMS)/HTVMSUtils.c
-
-
- # Library
- ***************
- *** 178,184 ****
-
- /pub/www/src/WWWLibrary_$(VC).tar.Z : $(SOURCES)
- tar cf /pub/www/src/WWWLibrary_$(VC).tar \
- ! $(SOURCES) $(SPECIFIC) $(WC)/*/Makefile $(WC)/vms/descrip.mms
- compress /pub/www/src/WWWLibrary_$(VC).tar
-
-
- --- 184,190 ----
-
- /pub/www/src/WWWLibrary_$(VC).tar.Z : $(SOURCES)
- tar cf /pub/www/src/WWWLibrary_$(VC).tar \
- ! $(SOURCES) $(SPECIFIC) $(WC)/*/Makefile
- compress /pub/www/src/WWWLibrary_$(VC).tar
-
-
- ***************
- *** 242,248 ****
- $(LOB)/HTStyle.o : $(OE) $(CMN)HTStyle.c $(CMN)HTUtils.h
- $(CC) -c -o $@ $(CFLAGS2) $(CMN)HTStyle.c
-
- ! $(LOB)/HTAtom.o : $(OE) $(CMN)HTAtom.c $(CMN)HTUtils.h
- $(CC) -c -o $@ $(CFLAGS2) $(CMN)HTAtom.c
-
- $(LOB)/HTChunk.o : $(OE) $(CMN)HTChunk.c $(CMN)HTUtils.h
- --- 248,254 ----
- $(LOB)/HTStyle.o : $(OE) $(CMN)HTStyle.c $(CMN)HTUtils.h
- $(CC) -c -o $@ $(CFLAGS2) $(CMN)HTStyle.c
-
- ! $(LOB)/HTAtom.o : $(OE) $(CMN)HTAtom.c $(CMN)HTUtils.h $(CMN)HTList.h
- $(CC) -c -o $@ $(CFLAGS2) $(CMN)HTAtom.c
-
- $(LOB)/HTChunk.o : $(OE) $(CMN)HTChunk.c $(CMN)HTUtils.h
- *** ../../../../2.13/WWW/Library/Implementation/HTAABrow.c Wed Nov 3 16:20:18 1993
- --- HTAABrow.c Mon Nov 15 16:11:29 1993
- ***************
- *** 622,628 ****
- outofmem(__FILE__, "compose_auth_string");
- #ifdef PUBKEY
- HTPK_encrypt(cleartext, ciphertext, server->public_key);
- ! HTUU_encode(ciphertext, strlen(ciphertext), result);
- #endif
- free(cleartext);
- free(ciphertext);
- --- 622,628 ----
- outofmem(__FILE__, "compose_auth_string");
- #ifdef PUBKEY
- HTPK_encrypt(cleartext, ciphertext, server->public_key);
- ! HTUU_encode((unsigned char *)ciphertext, strlen(ciphertext), result);
- #endif
- free(cleartext);
- free(ciphertext);
- ***************
- *** 630,636 ****
- else { /* scheme == HTAA_BASIC */
- if (!(result = (char*)malloc(4 * ((len+2)/3) + 1)))
- outofmem(__FILE__, "compose_auth_string");
- ! HTUU_encode(cleartext, strlen(cleartext), result);
- free(cleartext);
- }
- return result;
- --- 630,636 ----
- else { /* scheme == HTAA_BASIC */
- if (!(result = (char*)malloc(4 * ((len+2)/3) + 1)))
- outofmem(__FILE__, "compose_auth_string");
- ! HTUU_encode((unsigned char *)cleartext, strlen(cleartext), result);
- free(cleartext);
- }
- return result;
- *** ../../../../2.13/WWW/Library/Implementation/HTAAProt.c Wed Nov 3 16:20:19 1993
- --- HTAAProt.c Mon Nov 15 16:11:30 1993
- ***************
- *** 4,14 ****
- --- 4,17 ----
- **
- ** AUTHORS:
- ** AL Ari Luotonen luotonen@dxcern.cern.ch
- + ** MD Mark Donszelmann duns@vxdeop.cern.ch
- **
- ** HISTORY:
- ** 20 Oct 93 AL Now finds uid/gid for nobody/nogroup by name
- ** (doesn't use default 65534 right away).
- ** Also understands negative uids/gids.
- + ** 14 Nov 93 MD Added VMS compatibility
- + **
- ** BUGS:
- **
- **
- ***************
- *** 15,22 ****
- --- 18,27 ----
- */
-
- #include <string.h>
- + #ifndef VMS
- #include <pwd.h> /* Unix password file routine: getpwnam() */
- #include <grp.h> /* Unix group file routine: getgrnam() */
- + #endif /* not VMS */
-
- #include "HTUtils.h"
- #include "HTAAUtil.h"
- ***************
- *** 64,69 ****
- --- 69,112 ----
- }
-
-
- + #ifdef VMS
- +
- + /* PUBLIC HTAA_getUidName()
- + ** GET THE USER ID NAME (VMS ONLY)
- + ** ON ENTRY:
- + ** No arguments.
- + **
- + ** ON EXIT:
- + ** returns the user name
- + ** Default is "" (nobody).
- + */
- + PUBLIC char * HTAA_getUidName NOARGS
- + {
- + if (current_prot && current_prot->uid_name
- + && (0 != strcmp(current_prot->uid_name,"nobody")) )
- + return(current_prot->uid_name);
- + else
- + return("");
- + }
- +
- + /* PUBLIC HTAA_getFileName
- + ** GET THE FILENAME (VMS ONLY)
- + ** ON ENTRY:
- + ** No arguments.
- + **
- + ** ON EXIT:
- + ** returns the filename
- + */
- + PUBLIC char * HTAA_getFileName NOARGS
- + {
- + if (current_prot && current_prot->filename)
- + return(current_prot->filename);
- + else
- + return("");
- + }
- +
- + #else /* not VMS */
- +
- /* PUBLIC HTAA_getUid()
- ** GET THE USER ID TO CHANGE THE PROCESS UID TO
- ** ON ENTRY:
- ***************
- *** 115,120 ****
- --- 158,164 ----
- }
-
-
- +
- /* PUBLIC HTAA_getGid()
- ** GET THE GROUP ID TO CHANGE THE PROCESS GID TO
- ** ON ENTRY:
- ***************
- *** 163,168 ****
- --- 207,215 ----
- */
- return 65534; /* nogroup */
- }
- +
- + #endif /* not VMS */
- +
-
-
-
- *** ../../../../2.13/WWW/Library/Implementation/HTAAProt.h Tue Oct 5 11:04:40 1993
- --- HTAAProt.h Mon Nov 15 16:17:38 1993
- ***************
- *** 167,172 ****
- --- 167,173 ----
-
- */
-
- + #ifndef VMS
- /* PUBLIC HTAA_getUid()
- ** GET THE USER ID TO CHANGE THE PROCESS UID TO
- ** ON ENTRY:
- ***************
- *** 189,194 ****
- --- 190,224 ----
- ** Default is 65534 (nogroup).
- */
- PUBLIC int HTAA_getGid NOPARAMS;
- + #endif /* not VMS */
- + /*
- +
- + For VMS:
- +
- + */
- +
- + #ifdef VMS
- + /* PUBLIC HTAA_getUidName()
- + ** GET THE USER ID NAME (VMS ONLY)
- + ** ON ENTRY:
- + ** No arguments.
- + **
- + ** ON EXIT:
- + ** returns the user name
- + ** Default is "" (nobody).
- + */
- + PUBLIC char * HTAA_getUidName NOPARAMS;
- +
- + /* PUBLIC HTAA_getFileName
- + ** GET THE FILENAME (VMS ONLY)
- + ** ON ENTRY:
- + ** No arguments.
- + **
- + ** ON EXIT:
- + ** returns the filename
- + */
- + PUBLIC char * HTAA_getFileName NOPARAMS;
- + #endif /* VMS */
- /*
-
- */
- *** ../../../../2.13/WWW/Library/Implementation/HTAAServ.c Wed Nov 3 16:20:20 1993
- --- HTAAServ.c Thu Nov 11 11:23:30 1993
- ***************
- *** 114,123 ****
- case HTAA_DOTDOT:
- return "Forbidden -- URL containing /../ disallowed";
- break;
- ! /*
- ! ** It ought to, using an executable script (TBL)
- ! ** What do you mean, Tim?? (AL)
- ! */
-
- /* 404 cases */
- case HTAA_NOT_FOUND:
- --- 114,122 ----
- case HTAA_DOTDOT:
- return "Forbidden -- URL containing /../ disallowed";
- break;
- ! case HTAA_HTBIN:
- ! return "Forbidden -- /htbin feature not enabled on this server";
- ! break;
-
- /* 404 cases */
- case HTAA_NOT_FOUND:
- ***************
- *** 173,178 ****
- --- 172,180 ----
- case HTAA_DOTDOT:
- return "SLASH-DOT-DOT";
- break;
- + case HTAA_HTBIN:
- + return "HTBIN-OFF";
- + break;
-
- /* 404 cases */
- case HTAA_NOT_FOUND:
- ***************
- *** 432,438 ****
- char *local_copy = NULL;
- HTAAMethod method = HTAAMethod_enum(method_name);
- HTAAScheme scheme = HTAAScheme_enum(scheme_name);
- !
- /*
- ** Translate into absolute pathname, and
- ** check for "protect" and "defprot" rules.
- --- 434,442 ----
- char *local_copy = NULL;
- HTAAMethod method = HTAAMethod_enum(method_name);
- HTAAScheme scheme = HTAAScheme_enum(scheme_name);
- !
- ! HTAAFailReason = HTAA_OK;
- !
- /*
- ** Translate into absolute pathname, and
- ** check for "protect" and "defprot" rules.
- ***************
- *** 458,472 ****
- /* a /htbin call to set up */
- /* protections. */
- if (0 == strncmp(local_copy, "/htbin/", 7)) {
- - char *end = strchr(local_copy+7, '/');
- - if (end)
- - *end = (char)0;
- if (!HTBinDir)
- ! StrAllocCopy(HTBinDir, HTBINDIR);
- ! FREE(pathname);
- ! pathname = (char*)malloc(strlen(HTBinDir)+strlen(local_copy)-4);
- ! strcpy(pathname, HTBinDir);
- ! strcat(pathname, local_copy+6);
- }
-
- if (!pathname) { /* Forbidden by rule */
- --- 462,478 ----
- /* a /htbin call to set up */
- /* protections. */
- if (0 == strncmp(local_copy, "/htbin/", 7)) {
- if (!HTBinDir)
- ! HTAAFailReason = HTAA_HTBIN;
- ! else {
- ! char *end = strchr(local_copy+7, '/');
- ! if (end)
- ! *end = (char)0;
- ! FREE(pathname);
- ! pathname=(char*)malloc(strlen(HTBinDir)+strlen(local_copy)+1);
- ! strcpy(pathname, HTBinDir);
- ! strcat(pathname, local_copy+6);
- ! }
- }
-
- if (!pathname) { /* Forbidden by rule */
- ***************
- *** 474,482 ****
- "HTAA_checkAuthorization: Forbidden by rule\n");
- HTAAFailReason = HTAA_BY_RULE;
- }
- ! else { /* pathname != NULL */
- char *access = HTParse(pathname, "", PARSE_ACCESS);
- ! if (!*access || 0 == strcmp(access, "file")) { /*Local file, do AA*/
- if (!HTSecure && 0 != strncmp(local_copy, "/htbin/", 7)) {
- char *localname = HTLocalName(pathname);
- free(pathname);
- --- 480,489 ----
- "HTAA_checkAuthorization: Forbidden by rule\n");
- HTAAFailReason = HTAA_BY_RULE;
- }
- ! else if (HTAAFailReason != HTAA_HTBIN) {
- ! /* pathname != NULL */
- char *access = HTParse(pathname, "", PARSE_ACCESS);
- ! if (!*access || 0 == strcmp(access,"file")) { /*Local file, do AA*/
- if (!HTSecure && 0 != strncmp(local_copy, "/htbin/", 7)) {
- char *localname = HTLocalName(pathname);
- free(pathname);
- ***************
- *** 529,534 ****
- --- 536,542 ----
- case HTAA_NO_ENTRY:
- case HTAA_SETUP_ERROR:
- case HTAA_DOTDOT:
- + case HTAA_HTBIN:
- return 403;
- break;
-
- *** ../../../../2.13/WWW/Library/Implementation/HTAAUtil.c Thu Oct 7 14:42:18 1993
- --- HTAAUtil.c Thu Nov 11 11:23:30 1993
- ***************
- *** 33,40 ****
- --- 33,42 ----
- **
- ** AUTHORS:
- ** AL Ari Luotonen luotonen@dxcern.cern.ch
- + ** MD Mark Donszelmann duns@vxdeop.cern.ch
- **
- ** HISTORY:
- + ** 8 Nov 93 MD (VMS only) Added case insensitive comparison in HTAA_templateCaseMatch
- **
- **
- ** BUGS:
- ***************
- *** 224,230 ****
-
- for( ; *p && *q && *p == *q; p++, q++) /* Find first mismatch */
- ; /* do nothing else */
- !
- if (!*p && !*q) return YES; /* Equally long equal strings */
- else if ('*' == *p) { /* Wildcard */
- p++; /* Skip wildcard character */
- --- 226,232 ----
-
- for( ; *p && *q && *p == *q; p++, q++) /* Find first mismatch */
- ; /* do nothing else */
- !
- if (!*p && !*q) return YES; /* Equally long equal strings */
- else if ('*' == *p) { /* Wildcard */
- p++; /* Skip wildcard character */
- ***************
- *** 236,242 ****
- }
- } /* if wildcard */
- else return NO; /* Length or character mismatch */
- ! }
-
-
- /* PUBLIC HTAA_makeProtectionTemplate()
- --- 238,290 ----
- }
- } /* if wildcard */
- else return NO; /* Length or character mismatch */
- ! }
- !
- !
- ! /* PUBLIC HTAA_templateCaseMatch()
- ! ** STRING COMPARISON FUNCTION FOR FILE NAMES
- ! ** WITH ONE WILDCARD * IN THE TEMPLATE (Case Insensitive)
- ! ** NOTE:
- ! ** This is essentially the same code as in HTAA_templateMatch, but
- ! ** it compares case insensitive (for VMS). Reason for this routine
- ! ** is that HTAA_templateMatch gets called from several places, also
- ! ** there where a case sensitive match is needed, so one cannot just
- ! ** change the HTAA_templateMatch routine for VMS.
- ! **
- ! ** ON ENTRY:
- ! ** template is a template string to match the file name
- ! ** agaist, may contain a single wildcard
- ! ** character * which matches zero or more
- ! ** arbitrary characters.
- ! ** filename is the filename (or pathname) to be matched
- ! ** agaist the template.
- ! **
- ! ** ON EXIT:
- ! ** returns YES, if filename matches the template.
- ! ** NO, otherwise.
- ! */
- ! PUBLIC BOOL HTAA_templateCaseMatch ARGS2(CONST char *, template,
- ! CONST char *, filename)
- ! {
- ! CONST char *p = template;
- ! CONST char *q = filename;
- ! int m;
- !
- ! for( ; *p && *q && toupper(*p) == toupper(*q); p++, q++) /* Find first mismatch */
- ! ; /* do nothing else */
- !
- ! if (!*p && !*q) return YES; /* Equally long equal strings */
- ! else if ('*' == *p) { /* Wildcard */
- ! p++; /* Skip wildcard character */
- ! m = strlen(q) - strlen(p); /* Amount to match to wildcard */
- ! if (m < 0) return NO; /* No match, filename too short */
- ! else { /* Skip the matched characters and compare */
- ! if (strcasecomp(p, q+m)) return NO; /* Tail mismatch */
- ! else return YES; /* Tail match */
- ! }
- ! } /* if wildcard */
- ! else return NO; /* Length or character mismatch */
- ! }
-
-
- /* PUBLIC HTAA_makeProtectionTemplate()
- *** ../../../../2.13/WWW/Library/Implementation/HTAAUtil.h Thu Oct 7 14:44:23 1993
- --- HTAAUtil.h Mon Nov 15 16:17:37 1993
- ***************
- *** 218,223 ****
- --- 218,249 ----
- CONST char * filename));
-
-
- + /* PUBLIC HTAA_templateCaseMatch()
- + ** STRING COMPARISON FUNCTION FOR FILE NAMES
- + ** WITH ONE WILDCARD * IN THE TEMPLATE (Case Insensitive)
- + ** NOTE:
- + ** This is essentially the same code as in HTAA_templateMatch, but
- + ** it compares case insensitive (for VMS). Reason for this routine
- + ** is that HTAA_templateMatch gets called from several places, also
- + ** there where a case sensitive match is needed, so one cannot just
- + ** change the HTAA_templateMatch routine for VMS.
- + **
- + ** ON ENTRY:
- + ** template is a template string to match the file name
- + ** agaist, may contain a single wildcard
- + ** character * which matches zero or more
- + ** arbitrary characters.
- + ** filename is the filename (or pathname) to be matched
- + ** agaist the template.
- + **
- + ** ON EXIT:
- + ** returns YES, if filename matches the template.
- + ** NO, otherwise.
- + */
- + PUBLIC BOOL HTAA_templateCaseMatch PARAMS((CONST char * template,
- + CONST char * filename));
- +
- +
- /* PUBLIC HTAA_makeProtectionTemplate()
- ** CREATE A PROTECTION TEMPLATE FOR THE FILES
- ** IN THE SAME DIRECTORY AS THE GIVEN FILE
- *** ../../../../2.13/WWW/Library/Implementation/HTACL.c Wed Oct 13 16:53:41 1993
- --- HTACL.c Thu Nov 11 11:23:32 1993
- ***************
- *** 4,11 ****
- --- 4,13 ----
- **
- ** AUTHORS:
- ** AL Ari Luotonen luotonen@dxcern.cern.ch
- + ** MD Mark Donszelmann duns@vxdeop.cern.ch
- **
- ** HISTORY:
- + ** 8 Nov 93 MD (VMS only) case insensitive compare reading acl entry, filename
- **
- **
- ** BUGS:
- ***************
- *** 169,175 ****
- --- 171,181 ----
- outofmem(__FILE__, "HTAA_getAuthorizedGroups");
-
- while (EOF != HTAAFile_readField(acl_file, buf, len+1)) {
- + #ifdef VMS
- + if (HTAA_templateCaseMatch(buf, filename)) {
- + #else /* not VMS */
- if (HTAA_templateMatch(buf, filename)) {
- + #endif /* not VMS */
- HTList *methods = HTList_new();
- HTAAFile_readList(acl_file, methods, MAX_METHODNAME_LEN);
- if (TRACE) {
- *** ../../../../2.13/WWW/Library/Implementation/HTAtom.c Tue Apr 27 12:38:01 1993
- --- HTAtom.c Mon Nov 15 16:11:31 1993
- ***************
- *** 16,32 ****
- #include "HTAtom.h"
-
- #include <stdio.h> /* joe@athena, TBL 921019 */
- #include "HTUtils.h"
-
- PRIVATE HTAtom * hash_table[HASH_SIZE];
- PRIVATE BOOL initialised = NO;
-
- ! #ifdef __STDC__
- ! PUBLIC HTAtom * HTAtom_for(const char * string)
- ! #else
- ! PUBLIC HTAtom * HTAtom_for(string)
- ! char * string;
- ! #endif
- {
- int hash;
- CONST char * p;
- --- 16,30 ----
- #include "HTAtom.h"
-
- #include <stdio.h> /* joe@athena, TBL 921019 */
- + #include <string.h>
- +
- #include "HTUtils.h"
- + #include "HTList.h"
-
- PRIVATE HTAtom * hash_table[HASH_SIZE];
- PRIVATE BOOL initialised = NO;
-
- ! PUBLIC HTAtom * HTAtom_for ARGS1(CONST char *, string)
- {
- int hash;
- CONST char * p;
- ***************
- *** 70,73 ****
- --- 68,115 ----
- return a;
- }
-
- +
- + PRIVATE BOOL mime_match ARGS2(CONST char *, name,
- + CONST char *, templ)
- + {
- + if (name && templ) {
- + static char *n1 = NULL;
- + static char *t1 = NULL;
- + char *n2;
- + char *t2;
- +
- + StrAllocCopy(n1, name); /* These also free the ones */
- + StrAllocCopy(t1, templ); /* from previous call. */
- +
- + if (!(n2 = strchr(n1, '/')) || !(t2 = strchr(t1, '/')))
- + return NO;
- +
- + *(n2++) = (char)0;
- + *(t2++) = (char)0;
- +
- + if ((0==strcmp(t1, "*") || 0==strcmp(t1, n1)) &&
- + (0==strcmp(t2, "*") || 0==strcmp(t2, n2)))
- + return YES;
- + }
- + return NO;
- + }
- +
- +
- + PUBLIC HTList *HTAtom_templateMatches ARGS1(CONST char *, templ)
- + {
- + HTList *matches = HTList_new();
- +
- + if (initialised && templ) {
- + int i;
- + HTAtom *cur;
- +
- + for (i=0; i<HASH_SIZE; i++) {
- + for (cur = hash_table[i]; cur; cur=cur->next) {
- + if (mime_match(cur->name, templ))
- + HTList_addObject(matches, (void*)cur);
- + }
- + }
- + }
- + return matches;
- + }
-
- *** ../../../../2.13/WWW/Library/Implementation/HTAtom.h Thu Jun 10 11:55:24 1993
- --- HTAtom.h Mon Nov 15 16:17:32 1993
- ***************
- *** 21,26 ****
- --- 21,34 ----
- #ifndef HTATOM_H
- #define HTATOM_H
-
- + #include "HTUtils.h"
- + #include "HTList.h"
- +
- + #ifdef SHORT_NAMES
- + #define HTAt_for HTAtom_for
- + #define HTAt_tMa HTAtom_templateMatches
- + #endif /*SHORT_NAMES*/
- +
- typedef struct _HTAtom HTAtom;
- struct _HTAtom {
- HTAtom * next;
- ***************
- *** 28,38 ****
- }; /* struct _HTAtom */
-
-
- ! #ifdef __STDC__
- ! extern HTAtom * HTAtom_for(const char * string);
- ! #else
- ! extern HTAtom * HTAtom_for();
- ! #endif
-
- #define HTAtom_name(a) ((a)->name)
-
- --- 36,43 ----
- }; /* struct _HTAtom */
-
-
- ! PUBLIC HTAtom * HTAtom_for PARAMS((CONST char * string));
- ! PUBLIC HTList * HTAtom_templateMatches PARAMS((CONST char * templ));
-
- #define HTAtom_name(a) ((a)->name)
-
- *** ../../../../2.13/WWW/Library/Implementation/HTFile.c Thu Nov 4 10:54:15 1993
- --- HTFile.c Mon Nov 15 16:11:33 1993
- ***************
- *** 9,15 ****
- ** Apr 91 vms-vms access included using DECnet syntax
- ** 26 Jun 92 (JFG) When running over DECnet, suppressed FTP.
- ** Fixed access bug for relative names on VMS.
- ! ** Sep 92 (MD) Access to VMS files allows sharing.
- **
- ** Bugs:
- ** FTP: Cannot access VMS files from a unix machine.
- --- 9,16 ----
- ** Apr 91 vms-vms access included using DECnet syntax
- ** 26 Jun 92 (JFG) When running over DECnet, suppressed FTP.
- ** Fixed access bug for relative names on VMS.
- ! ** Sep 93 (MD) Access to VMS files allows sharing.
- ! ** 15 Nov 93 (MD) Moved HTVMSname to HTVMSUTILS.C
- **
- ** Bugs:
- ** FTP: Cannot access VMS files from a unix machine.
- ***************
- *** 25,30 ****
- --- 26,35 ----
-
- #include "HTUtils.h"
-
- + #ifdef VMS
- + #include "HTVMSUtils.h"
- + #endif /* VMS */
- +
- #include "HTParse.h"
- #include "tcp.h"
- #include "HTTCP.h"
- ***************
- *** 74,80 ****
-
- PRIVATE char *HTMountRoot = "/Net/"; /* Where to find mounts */
- #ifdef VMS
- ! PRIVATE char *HTCacheRoot = "/WWW$SCRATCH/"; /* Where to cache things */
- #else
- PRIVATE char *HTCacheRoot = "/tmp/W3_Cache_"; /* Where to cache things */
- #endif
- --- 79,85 ----
-
- PRIVATE char *HTMountRoot = "/Net/"; /* Where to find mounts */
- #ifdef VMS
- ! PRIVATE char *HTCacheRoot = "/WWW$SCRATCH"; /* Where to cache things */
- #else
- PRIVATE char *HTCacheRoot = "/tmp/W3_Cache_"; /* Where to cache things */
- #endif
- ***************
- *** 146,220 ****
-
-
-
- - #ifdef VMS
- - /* Convert unix-style name into VMS name
- - ** -------------------------------------
- - **
- - ** Bug: Returns pointer to static -- non-reentrant
- - */
- - PRIVATE char * vms_name(CONST char * nn, CONST char * fn)
- - {
-
- - /* We try converting the filename into Files-11 syntax. That is, we assume
- - ** first that the file is, like us, on a VMS node. We try remote
- - ** (or local) DECnet access. Files-11, VMS, VAX and DECnet
- - ** are trademarks of Digital Equipment Corporation.
- - ** The node is assumed to be local if the hostname WITHOUT DOMAIN
- - ** matches the local one. @@@
- - */
- - static char vmsname[INFINITY]; /* returned */
- - char * filename = (char*)malloc(strlen(fn)+1);
- - char * nodename = (char*)malloc(strlen(nn)+2+1); /* Copies to hack */
- - char *second; /* 2nd slash */
- - char *last; /* last slash */
- -
- - char * hostname = HTHostName();
-
- - if (!filename || !nodename) outofmem(__FILE__, "vms_name");
- - strcpy(filename, fn);
- - strcpy(nodename, ""); /* On same node? Yes if node names match */
- - {
- - char *p, *q;
- - for (p=hostname, q=nn; *p && *p!='.' && *q && *q!='.'; p++, q++){
- - if (TOUPPER(*p)!=TOUPPER(*q)) {
- - strcpy(nodename, nn);
- - q = strchr(nodename, '.'); /* Mismatch */
- - if (q) *q=0; /* Chop domain */
- - strcat(nodename, "::"); /* Try decnet anyway */
- - break;
- - }
- - }
- - }
-
- - second = strchr(filename+1, '/'); /* 2nd slash */
- - last = strrchr(filename, '/'); /* last slash */
- -
- - if (!second) { /* Only one slash */
- - sprintf(vmsname, "%s%s", nodename, filename + 1);
- - } else if(second==last) { /* Exactly two slashes */
- - *second = 0; /* Split filename from disk */
- - sprintf(vmsname, "%s%s:%s", nodename, filename+1, second+1);
- - *second = '/'; /* restore */
- - } else { /* More than two slashes */
- - char * p;
- - *second = 0; /* Split disk from directories */
- - *last = 0; /* Split dir from filename */
- - sprintf(vmsname, "%s%s:[%s]%s",
- - nodename, filename+1, second+1, last+1);
- - *second = *last = '/'; /* restore filename */
- - for (p=strchr(vmsname, '['); *p!=']'; p++)
- - if (*p=='/') *p='.'; /* Convert dir sep. to dots */
- - }
- - free(nodename);
- - free(filename);
- - return vmsname;
- - }
- -
- -
- - #endif /* VMS */
- -
- -
- -
- /* Send README file
- **
- ** If a README file exists, then it is inserted into the document here.
- --- 151,159 ----
- ***************
- *** 321,327 ****
-
- HTUnEscape(path); /* Interpret % signs */
-
- ! if (0==strcmp(access, "file")) {
- free(access);
- if ((0==strcasecomp(host, HTHostName())) ||
- (0==strcasecomp(host, "localhost")) || !*host) {
- --- 260,266 ----
-
- HTUnEscape(path); /* Interpret % signs */
-
- ! if (0==strcmp(access, "file")) { /* local file */
- free(access);
- if ((0==strcasecomp(host, HTHostName())) ||
- (0==strcasecomp(host, "localhost")) || !*host) {
- ***************
- *** 341,347 ****
- --- 280,293 ----
- } else { /* other access */
- char * result;
- CONST char * home = (CONST char*)getenv("HOME");
- + #ifdef VMS
- + if (!home)
- + home = HTCacheRoot;
- + else
- + home = HTVMS_wwwName(home);
- + #else /* not VMS */
- if (!home) home = "/tmp";
- + #endif /* not VMS */
- result = (char *)malloc(
- strlen(home)+strlen(access)+strlen(host)+strlen(path)+6+1);
- if (result == NULL) outofmem(__FILE__, "HTLocalName");
- ***************
- *** 722,729 ****
- {
- FILE * fp;
- char * vmsname = strchr(filename + 1, '/') ?
- ! vms_name(nodename, filename) : filename + 1;
- ! /* MD SEP 93, open files can be read... */
- fp = fopen(vmsname, "r", "shr=put", "shr=upd");
-
- /* If the file wasn't VMS syntax, then perhaps it is ultrix
- --- 668,674 ----
- {
- FILE * fp;
- char * vmsname = strchr(filename + 1, '/') ?
- ! HTVMS_name(nodename, filename) : filename + 1;
- fp = fopen(vmsname, "r", "shr=put", "shr=upd");
-
- /* If the file wasn't VMS syntax, then perhaps it is ultrix
- ***************
- *** 732,738 ****
- char ultrixname[INFINITY];
- if (TRACE) fprintf(stderr, "HTFile: Can't open as %s\n", vmsname);
- sprintf(ultrixname, "%s::\"%s\"", nodename, filename);
- - /* MD SEP 93, open files can be read... */
- fp = fopen(ultrixname, "r", "shr=put", "shr=upd");
- if (!fp) {
- if (TRACE) fprintf(stderr,
- --- 677,682 ----
- *** ../../../../2.13/WWW/Library/Implementation/HTFormat.h Thu Sep 2 18:02:28 1993
- --- HTFormat.h Tue Nov 16 15:27:49 1993
- ***************
- *** 156,161 ****
- --- 156,168 ----
-
- /*
-
- + The default presentation is used when no other is appriporate
- +
- + */
- + extern HTPresentation* default_presentation;
- +
- + /*
- +
- HTSetPresentation: Register a system command to present a format
-
- ON ENTRY,
- *** ../../../../2.13/WWW/Library/Implementation/HTGroup.h Thu Nov 4 10:07:16 1993
- --- HTGroup.h Mon Nov 15 16:17:37 1993
- ***************
- *** 39,44 ****
- --- 39,45 ----
- HTAA_NO_ENTRY, /* 403 Forbidden, no ACL entry */
- HTAA_SETUP_ERROR, /* 403 Forbidden, server setup error */
- HTAA_DOTDOT, /* 403 Forbidden, URL with /../ illegal */
- + HTAA_HTBIN, /* 403 Forbidden, /htbin not enabled */
- HTAA_NOT_FOUND /* 404 Not found, or read protected */
- } HTAAFailReasonType;
-
- *** ../../../../2.13/WWW/Library/Implementation/HTInit.h Thu Jun 10 11:55:29 1993
- --- HTInit.h Mon Nov 15 16:17:35 1993
- ***************
- *** 1,18 ****
- ! /* */
- !
- ! /* Initialisation module HTInit.h
- ! **
- ! ** This module resisters all the plug&play software modules which
- ! ** will be used in the program. This is for a browser.
- ! **
- ! ** To override this, just copy it and link in your version
- ! ** befoe you link with the library.
- ! */
- !
- #include "HTUtils.h"
-
- extern void HTFormatInit NOPARAMS;
- extern void HTFileInit NOPARAMS;
- /*
-
- */
- --- 1,20 ----
- ! /* /Net/dxcern/userd/timbl/hypertext/WWW/Library/Implementation/HTInit.html
- ! INITIALISATION MODULE
- !
- ! This module resisters all the plug & play software modules which will be used in the
- ! program. This is for a browser.
- !
- ! To override this, just copy it and link in your version befoe you link with the
- ! library.
- !
- ! Implemented by HTInit.c by default.
- !
- ! */
- #include "HTUtils.h"
-
- extern void HTFormatInit NOPARAMS;
- extern void HTFileInit NOPARAMS;
- +
- /*
-
- */
- *** ../../../../2.13/WWW/Library/Implementation/HTMLDTD.c Thu Nov 4 15:35:11 1993
- --- HTMLDTD.c Thu Nov 11 11:25:21 1993
- ***************
- *** 1,5 ****
- --- 1,8 ----
- /* Our Static DTD for HTML
- ** -----------------------
- + **
- + ** 6 Nov 93 MD Increased size of img_attr array to make space
- + ** for terminator.
- */
-
- /* Implements:
- *** ../../../../2.13/WWW/Library/Implementation/HTMLDTD.h Wed Nov 3 16:29:06 1993
- --- HTMLDTD.h Mon Nov 15 16:17:32 1993
- ***************
- *** 49,55 ****
- HTML_U, HTML_UL,
- HTML_VAR, HTML_XMP } HTMLElement;
-
- ! #define HTML_ELEMENTS 48
-
- /*
-
- --- 49,55 ----
- HTML_U, HTML_UL,
- HTML_VAR, HTML_XMP } HTMLElement;
-
- ! #define HTML_ELEMENTS 47
-
- /*
-
- *** ../../../../2.13/WWW/Library/Implementation/HTMLGen.c Wed Nov 3 16:21:46 1993
- --- HTMLGen.c Tue Nov 16 15:48:59 1993
- ***************
- *** 23,28 ****
- --- 23,29 ----
- #include "HTStream.h"
- #include "SGML.h"
- #include "HTFormat.h"
- + #include "tcp.h"
-
- #define PUTC(c) (*me->targetClass.put_character)(me->target, c)
- /* #define PUTS(s) (*me->targetClass.put_string)(me->target, s) */
- ***************
- *** 43,52 ****
- HTStream * target;
- HTStreamClass targetClass; /* COPY for speed */
-
- ! char buffer[BUFFER_SIZE];
- char * write_pointer;
- char * line_break;
- int cleanness;
- BOOL preformatted;
- };
-
- --- 44,54 ----
- HTStream * target;
- HTStreamClass targetClass; /* COPY for speed */
-
- ! char buffer[BUFFER_SIZE+1]; /* 1for NL */
- char * write_pointer;
- char * line_break;
- int cleanness;
- + BOOL delete_line_break_char;
- BOOL preformatted;
- };
-
- ***************
- *** 62,72 ****
- --- 64,85 ----
- me->write_pointer = me->buffer;
- me->line_break = me->buffer;
- me->cleanness = 0;
- + me->delete_line_break_char = NO;
- }
-
-
- /* Character handling
- ** ------------------
- + **
- + ** The tricky bits are the line break handling. This attempts
- + ** to synchrononise line breaks on sentence or phrase ends. This
- + ** is important if one stores SGML files in a line-oriented code
- + ** repository, so that if a small change is made, line ends don't
- + ** shift in a ripple-through to apparently change a large part of the
- + ** file. We give extra "cleanness" to spaces appearing directly
- + ** after periods (full stops), [semi]colons and commas.
- + ** This should make the source files easier to read and modify
- + ** by hand, too, though this is not a primary design consideration.
- */
- PRIVATE void HTMLGen_put_character ARGS2(HTStructured *, me, char, c)
- {
- ***************
- *** 79,107 ****
- }
-
- if ((!me->preformatted && c==' ')) {
- ! me->line_break = me->write_pointer;
- ! me->cleanness = 1;
- }
-
- /* Flush buffer out when full */
- if (me->write_pointer == me->buffer + BUFFER_SIZE) {
- if (me->cleanness) {
- ! me->line_break[-1] = '\n';
- (*me->targetClass.put_block)(me->target,
- me->buffer,
- ! me->line_break - me->buffer);
- { /* move next line in */
- ! char * p,*q;
- ! for(q=me->buffer, p=me->line_break; p < me->write_pointer; )
- *q++ = *p++;
- }
- me->cleanness = 0;
- } else {
- (*me->targetClass.put_block)(me->target,
- me->buffer,
- BUFFER_SIZE);
- }
- - me->write_pointer = me->buffer;
- me->line_break = me->buffer;
- }
- }
- --- 92,140 ----
- }
-
- if ((!me->preformatted && c==' ')) {
- ! int new_cleanness = 1;
- ! if (me->write_pointer > (me->buffer + 1)) {
- ! char delims[5];
- ! char * p;
- ! strcpy(delims, ",;:."); /* @@ english bias */
- ! p = strchr(delims, me->write_pointer[-2]);
- ! if (p) new_cleanness = p - delims + 2;
- ! }
- ! if (new_cleanness >= me->cleanness) {
- ! me->line_break = me->write_pointer - 1; /* Point to space */
- ! me->cleanness = new_cleanness;
- ! me->delete_line_break_char = YES;
- ! }
- }
-
- /* Flush buffer out when full */
- if (me->write_pointer == me->buffer + BUFFER_SIZE) {
- if (me->cleanness) {
- ! char line_break_char = me->line_break[0];
- ! char * saved = me->line_break;
- !
- ! if (me->delete_line_break_char) saved++;
- ! me->line_break[0] = '\n';
- (*me->targetClass.put_block)(me->target,
- me->buffer,
- ! me->line_break - me->buffer + 1);
- ! me->line_break[0] = line_break_char;
- { /* move next line in */
- ! char * p=saved;
- ! char *q;
- ! for(q=me->buffer; p < me->write_pointer; )
- *q++ = *p++;
- }
- me->cleanness = 0;
- + me->delete_line_break_char = 0;
- + me->write_pointer = me->write_pointer - (saved-me->buffer);
- +
- } else {
- (*me->targetClass.put_block)(me->target,
- me->buffer,
- BUFFER_SIZE);
- + me->write_pointer = me->buffer;
- }
- me->line_break = me->buffer;
- }
- }
- ***************
- *** 141,147 ****
- BOOL was_preformatted = me->preformatted;
- HTTag * tag = &HTML_dtd.tags[element_number];
-
- ! me->preformatted = NO;
- HTMLGen_put_character(me, '<');
- HTMLGen_put_string(me, tag->name);
- if (present) for (i=0; i< tag->number_of_attributes; i++) {
- --- 174,180 ----
- BOOL was_preformatted = me->preformatted;
- HTTag * tag = &HTML_dtd.tags[element_number];
-
- ! me->preformatted = NO; /* free text within tags */
- HTMLGen_put_character(me, '<');
- HTMLGen_put_string(me, tag->name);
- if (present) for (i=0; i< tag->number_of_attributes; i++) {
- ***************
- *** 157,162 ****
- --- 190,200 ----
- }
- HTMLGen_put_string(me, ">\n");
-
- + if (tag->contents != SGML_EMPTY) { /* can break after element start */
- + me->line_break = me->write_pointer; /* Don't you hate SGML? */
- + me->cleanness = 1;
- + me->delete_line_break_char = NO;
- + }
- /* Make very specific HTML assumption that PRE can't be
- nested! */
-
- ***************
- *** 178,183 ****
- --- 216,227 ----
- PRIVATE void HTMLGen_end_element ARGS2(HTStructured *, me,
- int , element_number)
- {
- + if (HTML_dtd.tags[element_number].contents != SGML_EMPTY) {
- + /* can break before element end */
- + me->line_break = me->write_pointer; /* Don't you hate SGML? */
- + me->cleanness = 1;
- + me->delete_line_break_char = NO;
- + }
- HTMLGen_put_string(me, "</");
- HTMLGen_put_string(me, HTML_dtd.tags[element_number].name);
- HTMLGen_put_character(me, '>');
- ***************
- *** 265,270 ****
- --- 309,315 ----
- me->write_pointer = me->buffer;
- me->line_break = me->buffer;
- me->cleanness = 0;
- + me->delete_line_break_char = NO;
- me->preformatted = NO;
- return me;
- }
- *** ../../../../2.13/WWW/Library/Implementation/HTPasswd.c Wed Nov 3 16:20:34 1993
- --- HTPasswd.c Thu Nov 11 11:23:42 1993
- ***************
- *** 4,11 ****
- --- 4,13 ----
- **
- ** AUTHORS:
- ** AL Ari Luotonen luotonen@dxcern.cern.ch
- + ** MD Mark Donszelmann duns@vxdeop.cern.ch
- **
- ** HISTORY:
- + ** 7 Nov 93 MD free for crypt taken out (static data returned)
- **
- **
- ** BUGS:
- ***************
- *** 101,107 ****
-
- tmp = crypt((char*)password, salt); /*crypt() doesn't change its args*/
- strcat(result, tmp);
- - free(tmp);
-
- cur += 8;
- len -= 8;
- --- 103,108 ----
- ***************
- *** 166,172 ****
-
- tmp = crypt((char*)password, salt);
- strcat(result, tmp);
- - free(tmp);
-
- cur1 += 8;
- cur2 += 13;
- --- 167,172 ----
- *** ../../../../2.13/WWW/Library/Implementation/HTRules.c Wed Nov 3 16:20:34 1993
- --- HTRules.c Thu Nov 11 11:23:43 1993
- ***************
- *** 41,47 ****
- --- 41,49 ----
- */
- PUBLIC char *HTBinDir = NULL; /* Physical /htbin directory path. */
- /* In future this should not be global. */
- + PUBLIC char *HTSearchScript = NULL; /* Search script name. */
-
- +
- /* Module-wide variables
- ** ---------------------
- */
- ***************
- *** 349,356 ****
- status >= 2 ? secs : 0.0,
- status >= 3 ? secs_per_byte : 0.0 );
-
- ! } else if (0==strcasecomp(word1, "htbin")) { /* Physical /htbin location */
- ! StrAllocCopy(HTBinDir, word2);
-
- } else {
- op = 0==strcasecomp(word1, "map") ? HT_Map
- --- 351,362 ----
- status >= 2 ? secs : 0.0,
- status >= 3 ? secs_per_byte : 0.0 );
-
- ! } else if (0==strncasecomp(word1, "htbin", 5) ||
- ! 0==strncasecomp(word1, "bindir", 6)) {
- ! StrAllocCopy(HTBinDir, word2); /* Physical /htbin location */
- !
- ! } else if (0==strncasecomp(word1, "search", 6)) {
- ! StrAllocCopy(HTSearchScript, word2); /* Search script name */
-
- } else {
- op = 0==strcasecomp(word1, "map") ? HT_Map
- *** ../../../../2.13/WWW/Library/Implementation/HTRules.h Thu Nov 4 10:07:13 1993
- --- HTRules.h Mon Nov 15 16:17:33 1993
- ***************
- *** 27,36 ****
- HT_Protect
- } HTRuleOp;
-
- ! #ifndef HTBINDIR
- ! #define HTBINDIR "/htbin" /* Default /htbin location */
- ! #endif
- extern char * HTBinDir; /* Physical /htbin location */
-
- /*
-
- --- 27,50 ----
- HT_Protect
- } HTRuleOp;
-
- ! #ifdef SHORT_NAMES
- ! #define HTSearSc HTSearchScript
- ! #endif /*SHORT_NAMES*/
- !
- ! /*
- !
- ! Server Side Script Execution
- !
- ! If a URL starts with /htbin/ it is understood to mean a script execution request on
- ! server. This feature needs to be turned on by setting HTBinDir by the htbin rule.
- ! Index searching is enabled by setting HTSearchScript into the name of script in BinDir
- ! doing the actual search by search rule (BinDir must also be set in this case, of
- ! course).
- !
- ! */
- !
- extern char * HTBinDir; /* Physical /htbin location */
- + extern char * HTSearchScript; /* Search script name */
-
- /*
-
- *** ../../../../2.13/WWW/Library/Implementation/HTTP.c Wed Oct 13 16:53:44 1993
- --- HTTP.c Thu Nov 11 11:23:44 1993
- ***************
- *** 144,150 ****
- hostname = HTParse((gate ? gate : arg), "", PARSE_HOST);
- if (hostname &&
- NULL != (colon = strchr(hostname, ':'))) {
- ! *(colon++) = NULL; /* Chop off port number */
- portnumber = atoi(colon);
- }
- else portnumber = 80;
- --- 144,150 ----
- hostname = HTParse((gate ? gate : arg), "", PARSE_HOST);
- if (hostname &&
- NULL != (colon = strchr(hostname, ':'))) {
- ! *(colon++) = '\0'; /* Chop off port number */
- portnumber = atoi(colon);
- }
- else portnumber = 80;
- *** ../../../../2.13/WWW/Library/Implementation/HTUtils.h Mon Oct 18 16:34:34 1993
- --- HTUtils.h Mon Nov 15 16:17:35 1993
- ***************
- *** 183,195 ****
- #define BOOL BOOLEAN
- #endif
- #ifndef YES
- ! #define YES (BOOL)1
- ! #define NO (BOOL)0
- #endif
-
- ! #ifndef min
- ! #define min(a,b) ((a) <= (b) ? (a) : (b))
- ! #define max(a,b) ((a) >= (b) ? (a) : (b))
- #endif
-
- #define TCP_PORT 80 /* Allocated to http by Jon Postel/ISI 24-Jan-92 */
- --- 183,195 ----
- #define BOOL BOOLEAN
- #endif
- #ifndef YES
- ! #define YES (BOOLEAN)1
- ! #define NO (BOOLEAN)0
- #endif
-
- ! #ifndef MIN
- ! #define MIN(a,b) ((a) <= (b) ? (a) : (b))
- ! #define MAX(a,b) ((a) >= (b) ? (a) : (b))
- #endif
-
- #define TCP_PORT 80 /* Allocated to http by Jon Postel/ISI 24-Jan-92 */
- ***************
- *** 210,215 ****
- --- 210,217 ----
- */
-
- #define HT_LOADED 29999 /* Instead of a socket */
- + #define HT_REDIRECTION_ON_FLY 29998 /* Redo the retrieve with a new URL */
- +
- #define HT_OK 0 /* Generic success*/
-
- #define HT_NO_ACCESS -10 /* Access not available */
- *** ../../../../2.13/WWW/Library/Implementation/Version.make Wed Nov 3 16:20:38 1993
- --- Version.make Thu Nov 11 11:23:48 1993
- ***************
- *** 1 ****
- ! VC = 2.13
- --- 1 ----
- ! VC = 2.14
-