CGIplus-enabled Run-time Environment Example
--------------------------------------------
***** FIRST, EVIDENCE OF PERSISTANCE *****
Usage Count: 3
***** SECOND, THE CGI ENVIRONMENT AVAILABLE *****
WWW_AUTH_TYPE=
WWW_CONTENT_LENGTH=0
WWW_CONTENT_TYPE=text/plain; charset=ISO-8859-1
WWW_DOCUMENT_ROOT=
WWW_GATEWAY_BG=BG2684:
WWW_GATEWAY_INTERFACE=CGI/1.1
WWW_GATEWAY_EOF=$Z-970FB1A4753A94556DC61912-
WWW_GATEWAY_EOT=$D-0FF9FD6B7A795DB09AA1F5F1-
WWW_GATEWAY_ESC=$E-03202EFE522687674521A87C-
WWW_GATEWAY_MRS=4492
WWW_HTTP_ACCEPT=*/*
WWW_HTTP_ACCEPT_ENCODING=gzip, br, zstd, deflate
WWW_HTTP_COOKIE=laikanxia_cookie_id=250123121128779; laikanxia_google_v=1
WWW_HTTP_HOST=polarhome.com:703
WWW_HTTP_USER_AGENT=Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
WWW_PATH_INFO=/just/a/bogus/path.txt
WWW_PATH_TRANSLATED=WASD_ROOT:[JUST.A.BOGUS]PATH.TXT
WWW_QUERY_STRING=query=string
WWW_REMOTE_ADDR=3.144.1.100
WWW_REMOTE_HOST=3.144.1.100
WWW_REMOTE_PORT=49931
WWW_REMOTE_USER=
WWW_REQUEST_METHOD=GET
WWW_REQUEST_SCHEME=http:
WWW_REQUEST_TIME_GMT=Thu, 23 Jan 2025 03:20:50 GMT
WWW_REQUEST_TIME_LOCAL=Thu, 23 Jan 2025 05:20:50
WWW_REQUEST_URI=/rtbin/version.h/just/a/bogus/path.txt?query=string
WWW_SCRIPT_FILENAME=WASD_ROOT:[SRC.HTTPD]VERSION.H
WWW_SCRIPT_NAME=/rtbin/version.h
WWW_SCRIPT_RTE=cgi-bin:[000000]rte_example.exe
WWW_SERVER_ADDR=192.168.10.2
WWW_SERVER_CHARSET=ISO-8859-1
WWW_SERVER_GMT=+02:00
WWW_SERVER_NAME=vax.polarhome.com
WWW_SERVER_PROTOCOL=HTTP/1.1
WWW_SERVER_PORT=80
WWW_SERVER_SIGNATURE=
WASD/10.3.0 Server at vax.polarhome.com Port 80
WWW_SERVER_SOFTWARE=HTTPd-WASD/10.3.0 OpenVMS/VAX
WWW_UNIQUE_ID=Z5HRsgAAAAQAAAIeLZk
WWW_SECURITY_STATUS=NONE
WWW_FORM_QUERY=string
WWW_KEY_COUNT=0
***** THIRD, AN "INTERPRETED" FILE (WWW_SCRIPT_NAME/WWW_SCRIPT_FILENAME) *****
[0001] /*****************************************************************************/
[0002] /*
[0003] version.h
[0004]
[0005]
[0006] VERSION HISTORY
[0007] ---------------
[0008] 06-OCT-2013 MGD v10.3.0
[0009] TLS1 Server Name Indication (SNI) extension
[0010] /SSL= parameter options rework (plus new mnemonic options)
[0011] SesolaNetClientBegin() include SNI before connect
[0012] PutWriteFileOpen() support FAB$C_STM and FAB$C_STMCR
[0013] DclMailboxAcl() allow usernames without associated
[0014] identifiers (i.e. shared UICs) by first trying with the
[0015] username and on failure getting the UIC and using that
[0016] FaoUrlEncodeTable tilde from "%7e" to "~" (cadaver issue)
[0017] GzipInit() ZLIB shareable image via logical names
[0018] WASD_LIBZ_SHR32, then GNV$LIBZSHR32, finally LIBZ_SHR32
[0019] PersonaAssume() wrap sys$persona_create() with SYSPRV
[0020] after modifications to DclMailboxAcl() to allow usernames
[0021] without associated identifiers (i.e. shared UICs)
[0022] authorisation realm read-only group can be specified as "*"
[0023] to represent that "everyone else" can read
[0024] ProxyResponseRebuild() additional header length bumped
[0025] from an ambit 256 to an ambit 1024 (Uni Malaga :-)
[0026] OdsNamBlockAst() on non-ODS_EXTENDED platforms (i.e. VAX)
[0027] tease-out system file name from Nam.nam$l_name and
[0028] Nam.nam$l_type into odsptr->SysFileName buffer
[0029] historically used by ODS-5 and munge for ODS-2 as well
[0030] .WWW_WASD directory directive file
[0031] sortable directory listing
[0032] ?httpd=index&ilink=[yes|no]
[0033] ?httpd=index&override=[yes|no]
[0034] ?httpd=index&query= (.WWW_WASD specific)
[0035] ?httpd=index&style=
[0036] ?httpd=index&sort=[+|-]
[0037] ?httpd=index&target=
[0038] ?httpd=index&these=[,]
[0039] ?httpd=index&versions=|*
[0040] SET dir=delimit=
[0041] SET dir=[no]ilink
[0042] SET dir=style=sort (plus the dir=style=2)
[0043] SET dir=sort=[+|-]
[0044] SET dir=target=
[0045] SET dir=these=[,]
[0046] SET dir=versions=|*
[0047] SET put=rfm=[STM|STMCR|UDF] added to FIX512,STMLF
[0048] [AuthRevalidateLoginCookie] obsolete (in favour of ...)
[0049] rqptr->AuthRevalidateCount to track empty authentication
[0050] prompts preceding potential redundant revalidation prompt
[0051] [PutBinaryRFM] add STM and STMCR
[0052] [ServiceNonSSLRedirect] |[:]
[0053] some refinements to Upd..() layout and functionality
[0054] refine HTML and bring a little more up-to-date
[0055] AUTH_MAX_USERNAME_LENGTH bumped from 47 to 64 for X509
[0056] FileAcpInfoAst() '$.' file extension kludge
[0057] bugfix; AuthConfigLoadCallBack() additional [AuthProxy]
[0058] with intervening rules should reset proxies
[0059] bugfix; FileResponseHeader() "?httpd=content&type=" decoded
[0060] bugfix; MapOds..() identify MFD using "000000]" and "000000."
[0061] bugfix; AuthVmsGetUai() interaction of logon= parameters
[0062] bugfix; UpdFileRename() ACCVIO with AuthAccessEnable()
[0063] bugfix; RequestParseAndExecute2() remove reset of
[0064] request persistent flag from OPTIONS and DELETE
[0065] bugfix; SesolaInitService() (or refinement)
[0066] SSL_CTX_set_session_id_context() against each service
[0067] bugfix; DirFormatSize() bytes
[0068] bugfix; OdsParseTerminate() on non-ODS_EXTENDED platforms
[0069] (i.e. VAX) reset .nam$b_esl to changed expanded length
[0070] or it can generate RMS$_ESL errors
[0071] bugfix; DavPropSearchAst() on non-ODS_EXTENDED platforms
[0072] (i.e. VAX) reset .nam$b_rsl to changed resultant length
[0073] or it can generate RMS$_RSL errors
[0074] bugfix; non-ODS_EXTENDED platforms (e.g. VAX) must
[0075] OdsParse() NAM$M_NOCONCEAL before OdsSearchNoConceal()
[0076] bugfix; MapUrl__Map() reverse mapping wildcard copy
[0077] bugfix; CgiGenerateVariables() AUTH_GROUP write/read status
[0078] bugfix; AuthClientHostGroup() wildcard match result reversed
[0079] bugfix; ProxyResponseRebuild() call ProxyRebuildLocation()
[0080] can return a pointer to the original location!
[0081] bugfix; SesolaInit() translate WASD_SSL_CIPHER logical name
[0082] 09-NOV-2012 MGD v10.2.0,
[0083] TOKEN authorisation
[0084] request header DNT (do not track)
[0085] set ProxyReadBufferSize to 64k (per JPP)
[0086] allow (proxy) ResponseBufferSize to be >= 64k (per JPP)
[0087] HttpdSystemInfo() $GETSYIW() CsidVersion treat status
[0088] SS$_UNREACHABLE as non-fatal and fallback to 16 byte LVB
[0089] DIGEST.C numerious tweaks up to RFC2069
[0090] [AuthTokenEntriesMax] for token authorisation
[0091] bugfix; HTAdminModifyUser() use database name for digest
[0092] bugfix; AuthorizeResponse() digest scheme
[0093] bugfix; AuthVmsGetUai() logon= fall through
[0094] bugfix; DclSysOutputAst() WebSocket wrt agent
[0095] bugfix; WebSockEnd() do not NetCloseSocket()
[0096] bugfix; (at least improve) caching of group write/read
[0097] bugfix; SesolaParseCertDn() return NULL if record not found
[0098] bugfix; AuthorizeGroupWrite() with cached entries!
[0099] bugfix; AuthReadSimpleList() parameter /DIRECTORY= processing
[0100] 28-APR-2012 MGD v10.1.1,
[0101] RequestGet() no longer report 408 for unused connections
[0102] RequestEndEnd() likewise ignore unused connections (Chrome)
[0103] MetaConLoad() compress non-signficant white-space
[0104] proxy WebSocket upgrade requests as raw tunnels (kludge)
[0105] DclRestartScript() refine WebSocket handling
[0106] DirFormatSize() now uses quadword
[0107] DirFormatSize() adjusts units to fit size width
[0108] MATCH0..8() macro to improve efficiency over memcmp()
[0109] SAME1..4() macro to abstract the *(USHORTPTR)s, etc.
[0110] bugfix; RequestBegin() remove RequestEnd() following failed
[0111] SesolaNetBegin() resulted in redundant request rundown
[0112] bugfix; SesolaNetAccept() initialise value=0
[0113] bugfix; SesolaNetRead() SSL state not SSL_ST_OK
[0114] bugfix; SesolaNetWrite() SSL state not SSL_ST_OK
[0115] bugfix; DavWebMicrosoftMunge2() token reprocessing
[0116] bugfix; FileAcpInfoAst() SS$_BADPARAM >2GB <4GB (per JPP)
[0117] bugfix; WebSockCloseMailboxes() logic
[0118] bugfix; DclScriptProcessCompletionAST() don't WebSockClose()
[0119] any WebSocket request currrently associated with the task
[0120] bugfix; RequestEndEnd() '->WebSocketCount' already locked
[0121] 06-NOV-2011 MGD v10.1.0,
[0122] dragged kicking and screaming to VMS V7.0 base build
[0123] Web Socket (HTML5) support
[0124] Secure Sockets default to SSL v3 and TLS v1 (no more SSL v2)
[0125] SET cache=[no]cookie
[0126] SET map=uri
[0127] SET proxy=chain=cred=
[0128] SET proxy=tunnel=request=
[0129] SET regex=
[0130] SET response=HTTP=original
[0131] SET service=
[0132] SET notimeout (short-hand for timeout=none,none,none)
[0133] SET websocket=
[0134] "origin:" conditional
[0135] "request-peek:" conditional
[0136] "upgrade:" conditional
[0137] "websocket:" conditional
[0138] [DclScriptProctor] (pro-)activate script/environments
[0139] [RegEx] enabled/disabled/
[0140] [ServiceProxyChainCred] down-stream proxy credentials
[0141] [WwwImplied] "www." is implied even with virtual services
[0142] ("Host:") not beginning with it (ServiceFindVirtual())
[0143] callout LIFETIME: can accept
[0144] callout SCRIPT-CONTROL:string (see DCL.C)
[0145] logging 'PP' outgoing proxy connection local port
[0146] /DO=ALIGN=.. to allow collection and analysis of Alpha and
[0147] Itanium alignment fault data using HttpdAlignFault() et.al.
[0148] /DO=NET=PURGE[=..] expanded capability
[0149] /DO=WEBSOCKET=DISCONNECT[=..] to disconnect WebSockets
[0150] /PRIORITY= limit increased from 6 to 15
[0151] SesolaInit() default is SSLv2 off and SSLv3/TLSv1 on
[0152] AuthAgentCallout() callout BODY implemented (for PAPI)
[0153] MapOdsUrlTo..() consecutive '/' into a single a la Unix
[0154] ServiceReportNow() service synopsis
[0155] ProxyTunnelChainConnect() chain proxy authorization
[0156] ProxyRequestRebuild() chain proxy authorization (BASIC only)
[0157] ServiceReportNow() add summary to service report
[0158] configuration lines beginning "!#" now allow WATCHable
[0159] during mapping and authorisation processing
[0160] reworked query string handling based on length
[0161] ServiceEntityMatch() processes in-match and if-not-match
[0162] CacheSearch() implement request cache control
[0163] CacheLoadResponse() checks response header for
[0164] "Cache-Control:" directives and adjusts accordingly
[0165] CacheLoadEnd() buffer all content-type data
[0166] (previous behaviour truncated at ';' or white-space)
[0167] MetaConLoad() ensure metacon "lines" are quadword aligned
[0168] __unaligned directive added to pointer macros in a
[0169] (successful) effort to avoid alignment faults
[0170] VM_OFFSET now 8 (quadword alignment) instead of 4
[0171] bugfix; OdsFileExists() parse NAM$M_NOCONCEAL in case of
[0172] multi-valued, concealed logical devices and then convert
[0173] returned status DNF into the functional equivalent FNF
[0174] bugfix; directory listing OdsSearchNoConceal() to
[0175] process concealed, multi-value logical device names
[0176] bugfix; RequestRedirect() only concat '&' if including query
[0177] bugfix; set rule 'CacheSetting' boolean with any CACHE=..
[0178] 02-OCT-2010 MGD v10.0.3,
[0179] command-line checks of configuration files
[0180] /DO=AUTH=CHECK /DO=CONFIG=CHECK (all configuration files)
[0181] /DO=GLOBAL=CHECK /DO=MAP=CHECK /DO=MSG=CHECK
[0182] /DO=SERVICE=CHECK
[0183] TcpIp6..() functions to resolve IPv6 AAAA records
[0184] ProxyRequestParse() improve IPv6 host parsing
[0185] bugfix; regression at 10.0.1 with proxy authorization
[0186] bugfix; SSL_set_info_callback() not SSL_CTX_set..()
[0187] 01-JUL-2010 MGD v10.0.2,
[0188] metacon "file:" and "directory:" to probe file-system
[0189] SET script=lifetime=
[0190] SET put=max= per-path equivalent of [PutMaxKbytes]
[0191] SET put=max=* for (effectively) unlimited upload
[0192] BODY.C significant rework to function()alise common code
[0193] BODY.C improve performance with multiblock of 127 (per JPP)
[0194] BODY.C make MultipartContentType(Ptr) a dynamic structure
[0195] as Microsoft endeavour to include application data
[0196] along with MIME content-type, see ...
[0197] http://msdn.microsoft.com/en-us/library/aa338205.aspx
[0198] and an example (no kidding!) ...
[0199] "application/vnd.ms.powerpoint.template.macroEnabled.12application/x-font"
[0200] FileNextBlocks() change QIO file size from long to quad
[0201] to cater for files greater than 4GB (4GB+ is limited to
[0202] file serving only, no ranges, etc.)
[0203] RequestExecutePostCache() UTF-8 decode WebDAV objects
[0204] RequestRedirect() support WebDAV "Destination:" field (JPP)
[0205] DclAllocateTask() default unconfigured CGIplus lifetime
[0206] SsiDoSet() and SsiGetTagValue() allow '$' in variable names
[0207] Mapurl_ControlReload() rather than Mapurl_Load()
[0208] bugfix; MapUrl_ControlReload()
[0209] bugfix; DclUpdateScriptNameCache() run-time pointer
[0210] bugfix; OdsNamBlockAst() odsptr->NamFileSysNamePtr
[0211] always set to odsptr->SysFileName in case RMS$_FNF, etc.
[0212] bugfix; RequestGet() MAX_REQUEST_HEADER (per JPP)
[0213] bugfix; allow METACON_TOKEN_INCLUDE for [IncludeFile]
[0214] bugfix; MetaConEvaluate() when JustChecking: HTTP header
[0215] fields (e.g. "cookie:")
[0216] bugfix; DavMetaReadName() and DavMetaWriteName()
[0217] allow for typeless file names (e.g. ]AFILE.;)
[0218] bugfix; PutWriteFileOpen() ensure SYSPRV enabled before
[0219] $ERASE() if not WebDAV request (access and ownership) (JPP)
[0220] bugfix; DavWebSlashlessMunge() enable SYSPRV while
[0221] calling OdsFileExists() (per JPP)
[0222] bugfix; do not use REDIRECT for WebDAV request error report
[0223] bugfix; no new token when refreshing existing lock (per JPP)
[0224] bugfix; FileNextBlocks() signed/unsigned comparison
[0225] when calculating buffer size on files larger than 2^31
[0226] bugfix; MapOdsUrlToOds5Vms() MapOdsElementsToVms()
[0227] include '|' and '%' as ODS-5 escaped characters
[0228] bugfix; DirAuthorizationAst() only check access on
[0229] non-empty expanded file names
[0230] bugfix; PutWriteFileOpen() ensure SYSPRV enabled before
[0231] $CREATE() if not WebDAV request (for access and ownership)
[0232] bugfix; FileNextBlocks() signed/unsigned comparison
[0233] when calculating buffer size on files larger than 2^31
[0234] bugfix; MapOdsUrlToOds5Vms() MapOdsElementsToVms()
[0235] include '|' as an ODS-5 escaped character
[0236] bugfix; DirAuthorizationAst() only check access on
[0237] non-empty expanded file names
[0238] bugfix; PutWriteFileOpen() ensure SYSPRV enabled before
[0239] $CREATE() if not WebDAV request (for access and ownership)
[0240] bugfix; DirBegin() "httpd=index&" detection (since v9.3.0)
[0241] bugfix; DirEnd() suppress