CGIplus-enabled Run-time Environment Example -------------------------------------------- ***** FIRST, EVIDENCE OF PERSISTANCE ***** Usage Count: 2 ***** SECOND, THE CGI ENVIRONMENT AVAILABLE ***** WWW_AUTH_TYPE= WWW_CONTENT_LENGTH=0 WWW_CONTENT_TYPE= WWW_DOCUMENT_ROOT= WWW_GATEWAY_BG=BG47998: WWW_GATEWAY_INTERFACE=CGI/1.1 WWW_GATEWAY_EOF=$Z-46AA6E7BAC91B7804E817181- WWW_GATEWAY_EOT=$D-E1EC714E5D65B177A5E9274C- WWW_GATEWAY_ESC=$E-D9FF53DDDC9560FA9A855A33- WWW_GATEWAY_MRS=4492 WWW_HTTP_CF_RAY=8e991d0c8f89dadc-ORD WWW_HTTP_USER_AGENT=Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) WWW_HTTP_HOST=675502.arinterhk.tech WWW_HTTP_CF_IPCOUNTRY=US WWW_HTTP_ACCEPT_ENCODING=gzip, br WWW_HTTP_X_FORWARDED_FOR=3.143.218.115 WWW_HTTP_X_FORWARDED_PROTO=https WWW_HTTP_ACCEPT=*/* WWW_HTTP_CF_CONNECTING_IP=3.143.218.115 WWW_HTTP_CF_VISITOR={"scheme":"https"} WWW_HTTP_CONNECTION=Keep-Alive WWW_HTTP_CDN_LOOP=cloudflare; loops=1 WWW_PATH_INFO= WWW_PATH_TRANSLATED= WWW_QUERY_STRING= WWW_REMOTE_ADDR=172.70.126.164 WWW_REMOTE_HOST=172.70.126.164 WWW_REMOTE_PORT=21928 WWW_REMOTE_USER= WWW_REQUEST_METHOD=GET WWW_REQUEST_PROTOCOL=HTTP/1.1 WWW_REQUEST_SCHEME=http: WWW_REQUEST_TIME_GMT=Thu, 28 Nov 2024 08:57:08 GMT WWW_REQUEST_TIME_LOCAL=Thu, 28 Nov 2024 09:57:08 WWW_REQUEST_URI=/rtbin/version.c WWW_SCRIPT_FILENAME=WASD_ROOT:[src.httpd]version.c WWW_SCRIPT_NAME=/rtbin/version.c WWW_SCRIPT_RTE=cgi-bin:[000000]rte_example.exe WWW_SERVER_ADDR=146.48.108.2 WWW_SERVER_CHARSET=ISO-8859-1 WWW_SERVER_GMT=+01:00 WWW_SERVER_NAME=ns1.gposta.it WWW_SERVER_PROTOCOL=HTTP/1.1 WWW_SERVER_PORT=80 WWW_SERVER_SIGNATURE=
WASD/11.5.1 Server at ns1.gposta.it Port 80
WWW_SERVER_SOFTWARE=HTTPd-WASD/11.5.1 OpenVMS/IA64 SSL WWW_UNIQUE_ID=Z0g_dAAAAAQkwAEpACU WWW_KEY_COUNT=0 ***** THIRD, AN "INTERPRETED" FILE (WWW_SCRIPT_NAME/WWW_SCRIPT_FILENAME) ***** [0001] /*****************************************************************************/ [0002] /* [0003] version.c [0004] [0005] Merely generate software ID and build information strings. [0006] [0007] [0008] 10-OCT-1999 MGD moved from HTTPD.C for v6.1 [0009] */ [0010] /*****************************************************************************/ [0011] [0012] #ifdef WASD_VMS_V7 [0013] #undef _VMS__V6__SOURCE [0014] #define _VMS__V6__SOURCE [0015] #undef __VMS_VER [0016] #define __VMS_VER 70000000 [0017] #undef __CRTL_VER [0018] #define __CRTL_VER 70000000 [0019] #endif [0020] [0021] #include [0022] #include [0023] [0024] #include "wasd.h" [0025] [0026] #ifdef __ia64 [0027] # define HTTPD_ARCH "IA64" [0028] #endif [0029] #ifdef __ALPHA [0030] # define HTTPD_ARCH "AXP" [0031] #endif [0032] #ifdef __VAX [0033] # define HTTPD_ARCH "VAX" [0034] #endif [0035] [0036] #ifndef BUILD_DATETIME [0037] # define BUILD_DATETIME __DATE__ " " __TIME__ [0038] #endif [0039] [0040] /******************/ [0041] /* global storage */ [0042] /******************/ [0043] [0044] int ActivityGblSecVersion = ACTIVITY_GBLSEC_VERSION_NUMBER, [0045] AuthGblSecVersion = AUTH_GBLSEC_VERSION_NUMBER, [0046] AuthTokenGblSecVersion = AUTH_TOKEN_GBLSEC_VERSION_NUMBER, [0047] HttpdGblSecVersion = HTTPD_GBLSEC_VERSION_NUMBER, [0048] SesolaGblSecVersion = SESOLA_GBLSEC_VERSION_NUMBER, [0049] ProxyVerifyGblSecVersion = PROXYVERIFY_GBLSEC_VERSION_NUMBER; [0050] [0051] ulong HttpdVersionNumber; [0052] [0053] char BuildDateTime [] = BUILD_DATETIME, [0054] BuildInfo [64], [0055] HttpdName [] = HTTPD_NAME, [0056] HttpdSoftwareIdName [] = HTTPD_SOFTWAREID_NAME, [0057] HttpdVersion [] = HTTPD_VERSION, [0058] SoftwareID [128]; [0059] [0060] /********************/ [0061] /* external storage */ [0062] /********************/ [0063] [0064] extern char HttpdSesola[]; [0065] [0066] /*****************************************************************************/ [0067] /* [0068] */ [0069] [0070] VersionInfo () [0071] [0072] { [0073] char *cptr, *sptr; [0074] [0075] /*********/ [0076] /* begin */ [0077] /*********/ [0078] [0079] /* server version as "11.10.9" into 111,009 */ [0080] sptr = HttpdVersion; [0081] HttpdVersionNumber = atoi(sptr) * 10000; [0082] while (isdigit(*sptr)) sptr++; [0083] if (*sptr == '.') sptr++; [0084] HttpdVersionNumber += atoi(sptr) * 100; [0085] while (isdigit(*sptr)) sptr++; [0086] if (*sptr == '.') sptr++; [0087] HttpdVersionNumber += atoi(sptr); [0088] [0089] /* software ID can be specified on the command line! */ [0090] if (!SoftwareID[0]) [0091] sprintf (SoftwareID, "%s/%s OpenVMS/%s%s", [0092] HttpdSoftwareIdName, HttpdVersion, HTTPD_ARCH, HttpdSesola); [0093] [0094] sprintf (BuildInfo, "%s VMS %s DECC %d%s", [0095] BUILD_DATETIME, __VMS_VERSION+1, __DECC_VER, [0096] OPERATE_WITH_SYSPRV ? " [/SYSPRV]" : ""); [0097] [0098] /* compress white-space */ [0099] cptr = sptr = BuildInfo; [0100] while (*cptr) [0101] { [0102] if (*cptr == ' ') [0103] { [0104] *sptr++ = *cptr++; [0105] while (*cptr == ' ') cptr++; [0106] } [0107] else [0108] *sptr++ = *cptr++; [0109] } [0110] *sptr = '\0'; [0111] } [0112] [0113] /*****************************************************************************/ [0114]