Changeset ee3afa2 in rtems


Ignore:
Timestamp:
Apr 11, 2003, 2:46:55 PM (17 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
2e7f00fc
Parents:
2f73363
Message:

2002-04-10 Mike Siers <mikes@…>

  • rtems_webserver/NOTES, rtems_webserver/asp.c, rtems_webserver/balloc.c, rtems_webserver/default.c, rtems_webserver/ej.h, rtems_webserver/ejIntrn.h, rtems_webserver/ejlex.c, rtems_webserver/ejparse.c, rtems_webserver/emfdb.c, rtems_webserver/emfdb.h, rtems_webserver/form.c, rtems_webserver/h.c, rtems_webserver/handler.c, rtems_webserver/license.txt, rtems_webserver/md5.h, rtems_webserver/md5c.c, rtems_webserver/mime.c, rtems_webserver/misc.c, rtems_webserver/ringq.c, rtems_webserver/rom.c, rtems_webserver/security.c, rtems_webserver/sock.c, rtems_webserver/sym.c, rtems_webserver/uemf.c, rtems_webserver/uemf.h, rtems_webserver/um.c, rtems_webserver/um.h, rtems_webserver/url.c, rtems_webserver/value.c, rtems_webserver/wbase64.c, rtems_webserver/webcomp.c, rtems_webserver/webpage.c, rtems_webserver/webrom.c, rtems_webserver/webs.c, rtems_webserver/webs.h, rtems_webserver/websuemf.c, rtems_webserver/wsIntrn.h: Update to GoAhead? Webserver 2.1.4. The following URL is the release notes from GoAhead?.

http://data.goahead.com/Software/Webserver/2.1.4/release.htm

I have only done a minimal amount of testing (i.e. the network
demo program works fine). Please try this out and let me know
if it works. The patch needs to be applied on the
c/src/libnetworking/rtems_webserver directory.

Files:
75 edited

Legend:

Unmodified
Added
Removed
  • c/src/libnetworking/ChangeLog

    r2f73363 ree3afa2  
     12002-04-10      Mike Siers <mikes@poliac.com>
     2
     3        * rtems_webserver/NOTES, rtems_webserver/asp.c,
     4        rtems_webserver/balloc.c, rtems_webserver/default.c,
     5        rtems_webserver/ej.h, rtems_webserver/ejIntrn.h,
     6        rtems_webserver/ejlex.c, rtems_webserver/ejparse.c,
     7        rtems_webserver/emfdb.c, rtems_webserver/emfdb.h,
     8        rtems_webserver/form.c, rtems_webserver/h.c,
     9        rtems_webserver/handler.c, rtems_webserver/license.txt,
     10        rtems_webserver/md5.h, rtems_webserver/md5c.c,
     11        rtems_webserver/mime.c, rtems_webserver/misc.c,
     12        rtems_webserver/ringq.c, rtems_webserver/rom.c,
     13        rtems_webserver/security.c, rtems_webserver/sock.c,
     14        rtems_webserver/sym.c, rtems_webserver/uemf.c,
     15        rtems_webserver/uemf.h, rtems_webserver/um.c, rtems_webserver/um.h,
     16        rtems_webserver/url.c, rtems_webserver/value.c,
     17        rtems_webserver/wbase64.c, rtems_webserver/webcomp.c,
     18        rtems_webserver/webpage.c, rtems_webserver/webrom.c,
     19        rtems_webserver/webs.c, rtems_webserver/webs.h,
     20        rtems_webserver/websuemf.c, rtems_webserver/wsIntrn.h:
     21        Update to GoAhead Webserver 2.1.4. The following URL is
     22        the release notes from GoAhead.
     23
     24            http://data.goahead.com/Software/Webserver/2.1.4/release.htm
     25
     26        I have only done a minimal amount of testing (i.e. the network
     27        demo program works fine).  Please try this out and let me know
     28        if it works.  The patch needs to be applied on the
     29        c/src/libnetworking/rtems_webserver directory.
     30
    1312003-04-10      Joel Sherrill <joel@OARcorp.com>
    232
  • c/src/libnetworking/rtems_webserver/NOTES

    r2f73363 ree3afa2  
    33#
    44
    5 Notes on merging GoAhead Webs 2.1.  Eventually RTEMS should be supported
     5Notes on merging GoAhead Webs 2.1.4.  Eventually RTEMS should be supported
    66in their distributions and this directory removed.
    77
     
    1010Obtain the original distribution from http://www.goahead.com for
    1111documentation.
     12
     13Porting
     14=======
     15 - added rtems complier flags to uemf.h and misc.c
     16 - following source files are distributed with the web server
     17    but not currently used by RTEMS
     18    [cgi.c, sockGen.c, umui.c, websSSL.c, websda.c]
    1219
    1320Tailoring
  • c/src/libnetworking/rtems_webserver/asp.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
  • c/src/libnetworking/rtems_webserver/balloc.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    2729#define IN_BALLOC
    2830
    29 #if UEMF
     31#ifdef UEMF
    3032        #include        "uemf.h"
    3133#else
     
    3638#include        <stdlib.h>
    3739
    38 #if !NO_BALLOC
     40#ifndef NO_BALLOC
    3941/********************************* Defines ************************************/
    4042
     
    4244 *      Define B_STATS if you wish to track memory block and stack usage
    4345 */
    44 #if B_STATS
     46#ifdef B_STATS
    4547/*
    4648 *      Optional statistics
     
    108110/*************************** Forward Declarations *****************************/
    109111
    110 #if B_STATS
     112#ifdef B_STATS
    111113static void bStatsAlloc(B_ARGS_DEC, void *ptr, int q, int size);
    112114static void bStatsFree(B_ARGS_DEC, void *ptr, int q, int size);
     
    115117#endif /* B_STATS */
    116118
    117 #if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD
     119#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
    118120static void bFillBlock(void *buf, int bufsize);
    119121#endif
    120122
    121 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     123#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    122124static void verifyUsedBlock(bType *bp, int q);
    123125static void verifyFreeBlock(bType *bp, int q);
     
    142144        bFlags = flags;
    143145
    144 #if BASTARD_TESTING
     146#ifdef BASTARD_TESTING
    145147        srand(time(0L));
    146148#endif /* BASTARD_TESTING */
     
    164166                        return -1;
    165167                }
    166 #if B_STATS
     168#ifdef B_STATS
    167169                bStatsMemMalloc += bufsize;
    168170#endif
     
    174176        bFreeBuf = bFreeNext = buf;
    175177        memset(bQhead, 0, sizeof(bQhead));
    176 #if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD
     178#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
    177179        bFillBlock(buf, bufsize);
    178180#endif
    179 #if B_STATS
     181#ifdef B_STATS
    180182        bStackStart = &buf;
    181183#endif
    182 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     184#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    183185        verifyFreeBlock(buf, bufsize);
    184186#endif
     
    193195void bclose()
    194196{
    195 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     197#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    196198        verifyBallocSpace();
    197199#endif
     
    221223                }
    222224        }
    223 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     225#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    224226        verifyBallocSpace();
    225227#endif
     
    228230        }
    229231
    230 #if BASTARD_TESTING
     232#ifdef BASTARD_TESTING
    231233        if (rand() == 0x7fff) {
    232234                return NULL;
     
    242244 */
    243245                if (bFlags & B_USE_MALLOC) {
    244 #if B_STATS
     246#ifdef B_STATS
    245247                        bstats(0, NULL);
    246248#endif
     
    253255                                return NULL;
    254256                        }
    255 #if B_STATS
     257#ifdef B_STATS
    256258                        bStatsMemMalloc += memSize;
    257259#endif
    258 #if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD
     260#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
    259261                        bFillBlock(bp, memSize);
    260262#endif
     
    276278 */
    277279                bQhead[q] = bp->u.next;
    278 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     280#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    279281                verifyFreeBlock(bp, q);
    280282#endif
    281 #if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD
     283#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
    282284                bFillBlock(bp, memSize);
    283285#endif
     
    292294 */
    293295                        bp = (bType*) bFreeNext;
    294 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     296#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    295297                        verifyFreeBlock(bp, q);
    296298#endif
    297299                        bFreeNext += memSize;
    298300                        bFreeLeft -= memSize;
    299 #if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD
     301#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
    300302                        bFillBlock(bp, memSize);
    301303#endif
     
    304306
    305307                } else if (bFlags & B_USE_MALLOC) {
    306 #if B_STATS
     308#ifdef B_STATS
    307309                        static int once = 0;
    308310                        if (once++ == 0) {
     
    320322                                return NULL;
    321323                        }
    322 #if B_STATS
     324#ifdef B_STATS
    323325                        bStatsMemMalloc += memSize;
    324326#endif
    325 #if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD
     327#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
    326328                        bFillBlock(bp, memSize);
    327329#endif
     
    335337        }
    336338
    337 #if B_STATS
     339#ifdef B_STATS
    338340        bStatsAlloc(B_ARGS, bp, q, memSize);
    339341#endif
     
    345347 */
    346348#if 0
    347 #if B_STATS
     349#ifdef B_STATS
    348350        if (bStatsBallocInUse == bStatsBallocMax) {
    349351                bstats(0, NULL);
     
    366368        int             q, memSize;
    367369
    368 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     370#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    369371        verifyBallocSpace();
    370372#endif
     
    379381        memSize = ballocGetSize(bp->u.size, &q);
    380382
    381 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     383#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    382384        verifyUsedBlock(bp,q);
    383385#endif
    384 #if B_STATS
     386#ifdef B_STATS
    385387        bStatsFree(B_ARGS, bp, q, bp->u.size+sizeof(bType));
    386388#endif
     
    390392        }
    391393               
    392 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     394#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    393395        bFillBlock(bp, memSize);
    394396#endif
     
    416418
    417419/******************************************************************************/
    418 #if UNICODE
     420#ifdef UNICODE
    419421/*
    420422 *      Duplicate a string, allow NULL pointers and then dup an empty string.
     
    511513
    512514/******************************************************************************/
    513 #if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD
     515#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
    514516/*
    515517 *      Fill the block (useful during development to catch zero fill assumptions)
     
    523525
    524526/******************************************************************************/
    525 #if B_STATS
     527#ifdef B_STATS
    526528/*
    527529 *      Statistics. Do output via calling the writefn callback function with
     
    817819
    818820/******************************************************************************/
    819 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     821#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    820822/*
    821823 *      The following routines verify the integrity of the balloc memory space.
     
    937939char_t *bstrdupNoBalloc(char_t *s)
    938940{
    939 #if UNICODE
     941#ifdef UNICODE
    940942        if (s) {
    941943                return wcsdup(s);
  • c/src/libnetworking/rtems_webserver/default.c

    r2f73363 ree3afa2  
    8585 *      Open the document. Stat for later use.
    8686 */
    87         if (websPageOpen(wp, lpath, path, SOCKET_RDONLY | SOCKET_BINARY,
    88                                 0666) < 0) {
    89                         websError(wp, 400,
    90                                 T("Cannot open URL <b>%s</b>"), url);
    91                         return 1;
    92                 }
    93                 if (websPageStat(wp, lpath, path, &sbuf) < 0) {
    94                         websError(wp, 400, T("Cannot stat page for URL <b>%s</b>"),
    95                                 url);
    96                         return 1;
    97                 }
     87        if (websPageOpen(wp, lpath, path, SOCKET_RDONLY | SOCKET_BINARY,
     88                0666) < 0) {
     89                websError(wp, 400, T("Cannot open URL <b>%s</b>"), url);
     90                return 1;
     91        }
     92
     93        if (websPageStat(wp, lpath, path, &sbuf) < 0) {
     94                websError(wp, 400, T("Cannot stat page for URL <b>%s</b>"), url);
     95                return 1;
     96        }
    9897
    9998/*
     
    103102 */
    104103        websStats.localHits++;
    105 #if WEBS_IF_MODIFIED_SUPPORT
     104#ifdef WEBS_IF_MODIFIED_SUPPORT
    106105        if (flags & WEBS_IF_MODIFIED && !(flags & WEBS_ASP)) {
    107106                if (sbuf.mtime <= wp->since) {
     
    228227        len = npart = 0;
    229228        parts[0] = NULL;
     229
     230   /*
     231    * 22 Jul 02 -- there were reports that a directory traversal exploit was
     232    * possible in the WebServer running under Windows if directory paths
     233    * outside the server's specified root web were given by URL-encoding the
     234    * backslash character, like:
     235    *
     236    *  GoAhead is vulnerable to a directory traversal bug. A request such as
     237    * 
     238    *  GoAhead-server/../../../../../../../ results in an error message
     239    *  'Cannot open URL'.
     240
     241    *  However, by encoding the '/' character, it is possible to break out of
     242    *  the
     243    *  web root and read arbitrary files from the server.
     244    *  Hence a request like:
     245    *
     246    *  GoAhead-server/..%5C..%5C..%5C..%5C..%5C..%5C/winnt/win.ini returns the
     247    *  contents of the win.ini file.
     248    * (Note that the description uses forward slashes (0x2F), but the example
     249    * uses backslashes (0x5C). In my tests, forward slashes are correctly
     250    * trapped, but backslashes are not. The code below substitutes forward
     251    * slashes for backslashes before attempting to validate that there are no
     252    * unauthorized paths being accessed.
     253    */
     254   token = gstrchr(path, '\\');
     255   while (token != NULL)
     256   {
     257      *token = '/';
     258      token = gstrchr(token, '\\');
     259   }
     260   
    230261        token = gstrtok(path, T("/"));
    231262
     
    285316        flags = websGetRequestFlags(wp);
    286317
    287         websMarkTime(wp);
     318        websSetTimeMark(wp);
    288319
    289320        wrote = bytes = 0;
     
    301332                if ((buf = balloc(B_L, PAGE_READ_BUFSIZE)) == NULL) {
    302333                        websError(wp, 200, T("Can't get memory"));
    303                 }
    304                 else {
     334                } else {
    305335                        while ((len = websPageReadData(wp, buf, PAGE_READ_BUFSIZE)) > 0) {
    306336                                if ((wrote = websWriteDataNonBlock(wp, buf, len)) < 0) {
  • c/src/libnetworking/rtems_webserver/ej.h

    r2f73363 ree3afa2  
    55 *
    66 *      See the file "license.txt" for information on usage and redistribution
     7 *
     8 * $Id$
    79 */
    810
     
    1921/********************************* Includes ***********************************/
    2022
    21 #if ! UEMF
     23#ifndef UEMF
    2224        #include        "basic/basic.h"
    2325        #include        "emf/emf.h"
  • c/src/libnetworking/rtems_webserver/ejIntrn.h

    r2f73363 ree3afa2  
    55 *
    66 *      See the file "license.txt" for information on usage and redistribution
     7 *
     8 * $Id$
    79 */
    810
     
    2325#include        <stdlib.h>
    2426
    25 #if CE
    26 #if ! UEMF
     27#ifdef CE
     28#ifndef UEMF
    2729        #include        <io.h>
    2830#endif
    2931#endif
    3032
    31 #if LYNX
     33#ifdef LYNX
    3234        #include        <unistd.h>
    3335#endif
     
    3739#endif
    3840
    39 #if UEMF
     41#ifdef UEMF
    4042        #include        "uemf.h"
    4143#else
  • c/src/libnetworking/rtems_webserver/ejlex.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    1820#include        "ejIntrn.h"
    1921
    20 #if UEMF
     22#ifdef UEMF
    2123        #include "uemf.h"
    2224#else
     
    195197{
    196198        ep->tid = getLexicalToken(ep, state);
     199   /*
     200    * commented out 04 Apr 02 Bg Porter -- we found a case where very long
     201    * arguments to write() were being corrupted downstream in the trace call
     202    * (the ep->token pointer was being overwritten with the trace message.
     203    * restore this if it's useful for your debugging.
    197204        trace(9, T("ejGetToken: %d, \"%s\"\n"), ep->tid, ep->token);
     205    */
    198206        return ep->tid;
    199207}
  • c/src/libnetworking/rtems_webserver/ejparse.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    1820#include        "ejIntrn.h"
    1921
    20 #if CE
     22#ifdef CE
    2123        #include        "CE/wincompat.h"
    2224#endif
     
    99101        ejSetGlobalVar(ep->eid, T("null"), NULL);
    100102
    101 #if EMF
     103#ifdef EMF
    102104        ejEmfOpen(ep->eid);
    103105#endif
     
    119121        }
    120122
    121 #if EMF
     123#ifdef EMF
    122124        ejEmfClose(eid);
    123125#endif
  • c/src/libnetworking/rtems_webserver/emfdb.c

    r2f73363 ree3afa2  
    663663        if (pLineOut) {
    664664                len = gstrlen(pLineOut);
    665 #if CE
     665#ifdef CE
    666666                rc = writeUniToAsc(fd, pLineOut, len);
    667667#else
     
    854854 */
    855855        buf = balloc(B_L, sbuf.st_size + 1);
    856 #if CE
     856#ifdef CE
    857857        if (readAscToUni(fd, &buf, sbuf.st_size) != (int)sbuf.st_size) {
    858858#else
     
    10201020        int len;
    10211021
    1022         if (basicProdDir != NULL) {
    1023                 bfree(B_L, basicProdDir);
     1022        if (basicProdDir != NULL) {     
     1023      bfree(B_L, basicProdDir);
    10241024        }
    10251025   
  • c/src/libnetworking/rtems_webserver/emfdb.h

    r2f73363 ree3afa2  
    1919#define _h_EMFDB 1
    2020
    21 #if ! UEMF
     21#ifndef UEMF
    2222        #include        "basic/basic.h"
    2323        #include        "emf/emf.h"
  • c/src/libnetworking/rtems_webserver/form.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
  • c/src/libnetworking/rtems_webserver/h.c

    r2f73363 ree3afa2  
    44 * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
    55 * See the file "license.txt" for usage and redistribution license requirements
     6 *
     7 * $Id$
    68 */
    79
     
    1618/********************************* Includes ***********************************/
    1719
    18 #if UEMF
     20#ifdef UEMF
    1921        #include        "uemf.h"
    2022#else
     
    4244 */
    4345
    44 #if B_STATS
     46#ifdef B_STATS
    4547int HALLOC(B_ARGS_DEC, void ***map)
    4648#else
     
    5658                incr = H_INCR;
    5759                memsize = (incr + H_OFFSET) * sizeof(void**);
    58 #if B_STATS
     60#ifdef B_STATS
    5961                if ((mp = (int*) balloc(B_ARGS, memsize)) == NULL) {
    6062#else
     
    149151 */
    150152
    151 #if B_STATS
     153#ifdef B_STATS
    152154int HALLOCENTRY(B_ARGS_DEC, void ***list, int *max, int size)
    153155#else
     
    161163        a_assert(max);
    162164
    163 #if B_STATS
     165#ifdef B_STATS
    164166        if ((id = HALLOC(B_ARGS, (void***) list)) < 0) {
    165167#else
     
    170172
    171173        if (size > 0) {
    172 #if B_STATS
     174#ifdef B_STATS
    173175                if ((cp = balloc(B_ARGS, size)) == NULL) {
    174176#else
  • c/src/libnetworking/rtems_webserver/handler.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    2628/**************************** Forward Declarations ****************************/
    2729
    28 static int      websUrlHandlerSort(const void *p1, const void *p2);
    29 static int      websPublishHandler(webs_t wp, char_t *urlPrefix, char_t *webDir,
     30static int              websUrlHandlerSort(const void *p1, const void *p2);
     31static int              websPublishHandler(webs_t wp, char_t *urlPrefix, char_t *webDir,
    3032                                int sid, char_t *url, char_t *path, char_t *query);
    31 static int      websTidyUrl(webs_t wp);
     33static char_t   *websCondenseMultipleChars(char_t *strToCondense, char_t cCondense);
    3234
    3335/*********************************** Code *************************************/
     
    257259        websSetRequestPath(wp, websGetDefaultDir(), NULL);
    258260
    259         websTidyUrl(wp);
     261/*
     262 *      Eliminate security hole
     263 */
     264        websCondenseMultipleChars(wp->path, '/');
     265        websCondenseMultipleChars(wp->url, '/');
    260266
    261267/*
     
    293299}
    294300
     301#ifdef OBSOLETE_CODE
    295302
    296303/******************************************************************************/
     
    359366}
    360367
    361 /******************************************************************************/
     368#endif
     369
     370/******************************************************************************/
     371/*
     372 *      Convert multiple adjacent occurrences of a given character to a single
     373 *      instance.
     374 */
     375
     376static char_t *websCondenseMultipleChars(char_t *strToCondense, char_t cCondense)
     377{
     378        if (strToCondense != NULL) {
     379                char_t *pStr, *pScan;
     380
     381                pStr = pScan = strToCondense;
     382
     383                while (*pScan && *pStr) {
     384/*
     385 *                      Advance scan pointer over multiple occurences of condense character
     386 */
     387                        while ((*pScan == cCondense) && (*(pScan + 1) == cCondense)) {
     388                                pScan++;
     389                        }
     390/*
     391 *                      Copy character if an advance of the scan pointer has occurred
     392 */
     393                        if (pStr != pScan) {
     394                                *pStr = *pScan;
     395                        }
     396                       
     397                        pScan++;
     398                        pStr++;
     399                }
     400/*
     401 *              Zero terminate string if multiple adjacent characters were found and condensed
     402 */
     403                if (pStr != pScan) {
     404                        *pStr = 0;
     405                }
     406        }
     407
     408        return strToCondense;
     409}
     410
     411/******************************************************************************/
  • c/src/libnetworking/rtems_webserver/license.txt

    r2f73363 ree3afa2  
    11License Agreement
    22
    3 THIS LICENSE ALLOWS ONLY THE LIMITED USE OF GO AHEAD SOFTWARE, INC. PROPRIETARY CODE.  PLEASE CAREFULLY READ THIS AGREEMENT AS IT PERTAINS TO THIS LICENSE, YOU CERTIFY THAT YOU WILL USE THE SOFTWARE ONLY IN THE MANNER PERMITTED HEREIN.
     3THIS LICENSE ALLOWS ONLY THE LIMITED USE OF GO AHEAD SOFTWARE,
     4INC. PROPRIETARY CODE.  PLEASE CAREFULLY READ THIS AGREEMENT AS IT
     5PERTAINS TO THIS LICENSE, YOU CERTIFY THAT YOU WILL USE THE SOFTWARE
     6ONLY IN THE MANNER PERMITTED HEREIN.
    47
    581. Definitions.
    69
    7 1.1 "Documentation" means any documentation GoAhead includes with the Original Code.
     101.1 "Documentation" means any documentation GoAhead includes with the
     11Original Code.
    812
    9131.2 "GoAhead" means Go Ahead Software, Inc.
    1014
    11 1.3 "Intellectual Property Rights" means all rights, whether now existing or hereinafter acquired, in and to trade secrets, patents, copyrights, trademarks, know-how, as well as moral rights and similar rights of any type under the laws of any governmental authority, domestic or foreign, including rights in and to all applications and registrations relating to any of the foregoing.
     151.3 "Intellectual Property Rights" means all rights, whether now existing
     16or hereinafter acquired, in and to trade secrets, patents, copyrights,
     17trademarks, know-how, as well as moral rights and similar rights of any
     18type under the laws of any governmental authority, domestic or foreign,
     19including rights in and to all applications and registrations relating
     20to any of the foregoing.
    1221
    13221.4 "License" or "Agreement" means this document.
    1423
    15 1.5 "Modifications" means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications.
    16 
    17 1.6 "Original Code" means the Source Code to GoAhead’s proprietary computer software entitled GoAhead WebServer.
    18 
    19 1.7 "Response Header" means the first portion of the response message output by the GoAhead WebServer, containing but not limited to, header fields for date, content-type, server identification and cache control.
    20 
    21 1.8 "Server Identification Field" means the field in the Response Header which contains the text "Server: GoAhead-Webs".
    22 
    23 1.9 "You" means an individual or a legal entity exercising rights under, and complying with all of the terms of, this license or a future version of this license. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.
     241.5 "Modifications" means any addition to or deletion from the substance
     25or structure of either the Original Code or any previous Modifications.
     26
     271.6 "Original Code" means the Source Code to GoAhead’s proprietary
     28computer software entitled GoAhead WebServer.
     29
     301.7 "Response Header" means the first portion of the response message
     31output by the GoAhead WebServer, containing but not limited to, header
     32fields for date, content-type, server identification and cache control.
     33
     341.8 "Server Identification Field" means the field in the Response Header
     35which contains the text "Server: GoAhead-Webs".
     36
     371.9 "You" means an individual or a legal entity exercising rights under,
     38and complying with all of the terms of, this license or a future version
     39of this license. For legal entities, "You" includes any entity which
     40controls, is controlled by, or is under common control with You. For
     41purposes of this definition, "control" means (a) the power, direct or
     42indirect, to cause the direction or management of such entity, whether
     43by contract or otherwise, or (b) ownership of fifty percent (50%) or
     44more of the outstanding shares or beneficial ownership of such entity.
    2445
    25462. Source Code License.
     
    27482.1 Limited Source Code Grant.
    2849
    29 GoAhead hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims, to use, reproduce, modify, copy and distribute the Original Code.
     50GoAhead hereby grants You a world-wide, royalty-free, non-exclusive
     51license, subject to third party intellectual property claims, to use,
     52reproduce, modify, copy and distribute the Original Code.
    3053
    31542.2 Binary Code.
    3255
    33 GoAhead hereby grants You a world-wide, royalty-free, non-exclusive license to copy and distribute the binary code versions of the Original Code together with Your Modifications.
     56GoAhead hereby grants You a world-wide, royalty-free, non-exclusive
     57license to copy and distribute the binary code versions of the Original
     58Code together with Your Modifications.
    3459
    35602.3 License Back to GoAhead.
    3661
    37 You hereby grant in both source code and binary code to GoAhead a world-wide, royalty-free, non-exclusive license to copy, modify, display, use and sublicense any Modifications You make that are distributed or planned for distribution.  Within 30 days of either such event, You agree to ship to GoAhead a file containing the Modifications (in a media to be determined by the parties), including any programmers’ notes and other programmers’ materials. Additionally, You will provide to GoAhead a complete description of the product, the product code or model number, the date on which the product is initially shipped, and a contact name, phone number and e-mail address for future correspondence. GoAhead will keep confidential all data specifically marked as such.
     62You hereby grant in both source code and binary code to GoAhead a
     63world-wide, royalty-free, non-exclusive license to copy, modify, display,
     64use and sublicense any Modifications You make that are distributed or
     65planned for distribution.  Within 30 days of either such event, You
     66agree to ship to GoAhead a file containing the Modifications (in a media
     67to be determined by the parties), including any programmers’ notes and
     68other programmers’ materials. Additionally, You will provide to GoAhead
     69a complete description of the product, the product code or model number,
     70the date on which the product is initially shipped, and a contact name,
     71phone number and e-mail address for future correspondence. GoAhead will
     72keep confidential all data specifically marked as such.
    3873
    39742.4 Restrictions on Use.
    4075
    41 You may sublicense Modifications to third parties such as subcontractors or OEM's provided that You enter into license agreements with such third parties that bind such third parties to all the obligations under this Agreement applicable to you and that are otherwise substantially similar in scope and application to this Agreement.
     76You may sublicense Modifications to third parties such as subcontractors
     77or OEM's provided that You enter into license agreements with such third
     78parties that bind such third parties to all the obligations under this
     79Agreement applicable to you and that are otherwise substantially similar
     80in scope and application to this Agreement.
    4281
    43823. Term.
    4483
    45 This Agreement and license are effective from the time You accept the terms of this Agreement until this Agreement is terminated. You may terminate this Agreement at any time by uninstalling or destroying all copies of the Original Code including any and all binary versions and removing any Modifications to the Original Code existing in any products. This Agreement will terminate immediately and without further notice if You fail to comply with any provision of this Agreement. All restrictions on use, and all other provisions that may reasonably be interpreted to survive termination of this Agreement, will survive termination of this Agreement for any reason. Upon termination, You agree to uninstall or destroy all copies of the Original Code, Modifications, and Documentation.
     84This Agreement and license are effective from the time You accept the
     85terms of this Agreement until this Agreement is terminated. You may
     86terminate this Agreement at any time by uninstalling or destroying
     87all copies of the Original Code including any and all binary versions
     88and removing any Modifications to the Original Code existing in any
     89products. This Agreement will terminate immediately and without further
     90notice if You fail to comply with any provision of this Agreement. All
     91restrictions on use, and all other provisions that may reasonably
     92be interpreted to survive termination of this Agreement, will survive
     93termination of this Agreement for any reason. Upon termination, You agree
     94to uninstall or destroy all copies of the Original Code, Modifications,
     95and Documentation.
    4696
    47974. Trademarks and Brand.
     
    49994.1 License and Use.
    50100
    51 GoAhead hereby grants to You a limited world-wide, royalty-free, non-exclusive license to use the GoAhead trade names, trademarks, logos, service marks and product designations posted in Exhibit A (collectively, the "GoAhead Marks") in connection with the activities by You under this Agreement. Additionally, GoAhead grants You a license under the terms above to such GoAhead trademarks as shall be identified at a URL (the "URL") provided by GoAhead. The use by You of GoAhead Marks shall be in accordance with GoAhead’s trademark policies regarding trademark usage as established at the web site designated by the URL, or as otherwise communicated to You by GoAhead at its sole discretion. You understand and agree that any use of GoAhead Marks in connection with this Agreement shall not create any right, title or interest in or to such GoAhead Marks and that all such use and goodwill associated with GoAhead Marks will inure to the benefit of GoAhead.
     101GoAhead hereby grants to You a limited world-wide, royalty-free,
     102non-exclusive license to use the GoAhead trade names, trademarks, logos,
     103service marks and product designations posted in Exhibit A (collectively,
     104the "GoAhead Marks") in connection with the activities by You under this
     105Agreement. Additionally, GoAhead grants You a license under the terms
     106above to such GoAhead trademarks as shall be identified at a URL (the
     107"URL") provided by GoAhead. The use by You of GoAhead Marks shall be in
     108accordance with GoAhead’s trademark policies regarding trademark usage
     109as established at the web site designated by the URL, or as otherwise
     110communicated to You by GoAhead at its sole discretion. You understand and
     111agree that any use of GoAhead Marks in connection with this Agreement
     112shall not create any right, title or interest in or to such GoAhead
     113Marks and that all such use and goodwill associated with GoAhead Marks
     114will inure to the benefit of GoAhead.
    52115
    531164.2 Promotion by You of GoAhead WebServer Mark.
    54117
    55 In consideration for the licenses granted by GoAhead to You herein, You agree to notify GoAhead when You incorporate the GoAhead WebServer in Your product and to inform GoAhead when such product begins to ship. You agree to promote the Original Code by prominently and visibly displaying a graphic of the GoAhead WebServer mark on the initial web page of Your product that is displayed each time a user connects to it. You also agree that GoAhead may identify your company as a user of the GoAhead WebServer in conjunction with its own marketing efforts. You may further promote the Original Code by displaying the GoAhead WebServer mark in marketing and promotional materials such as the home page of your web site or web pages promoting the product.
     118In consideration for the licenses granted by GoAhead to You herein, You
     119agree to notify GoAhead when You incorporate the GoAhead WebServer in
     120Your product and to inform GoAhead when such product begins to ship. You
     121agree to promote the Original Code by prominently and visibly displaying
     122a graphic of the GoAhead WebServer mark on the initial web page of Your
     123product that is displayed each time a user connects to it. You also agree
     124that GoAhead may identify your company as a user of the GoAhead WebServer
     125in conjunction with its own marketing efforts. You may further promote
     126the Original Code by displaying the GoAhead WebServer mark in marketing
     127and promotional materials such as the home page of your web site or web
     128pages promoting the product.
    56129
    571304.3 Placement of Copyright Notice by You.
    58131
    59 You agree to include copies of the following notice (the "Notice") regarding proprietary rights in all copies of the products that You distribute, as follows: (i) embedded in the object code; and (ii) on the title pages of all documentation. Furthermore, You agree to use commercially reasonable efforts to cause any licensees of your products to embed the Notice in object code and on the title pages or relevant documentation. The Notice is as follows: Copyright (c) 20xx GoAhead Software, Inc. All Rights Reserved. Unless GoAhead otherwise instructs, the year 20xx is to be replaced with the year during which the release of the Original Code containing the notice is issued by GoAhead. If this year is not supplied with Documentation, GoAhead will supply it upon request.
     132You agree to include copies of the following notice (the "Notice")
     133regarding proprietary rights in all copies of the products that You
     134distribute, as follows: (i) embedded in the object code; and (ii) on
     135the title pages of all documentation. Furthermore, You agree to use
     136commercially reasonable efforts to cause any licensees of your products
     137to embed the Notice in object code and on the title pages or relevant
     138documentation. The Notice is as follows: Copyright (c) 20xx GoAhead
     139Software, Inc. All Rights Reserved. Unless GoAhead otherwise instructs,
     140the year 20xx is to be replaced with the year during which the release of
     141the Original Code containing the notice is issued by GoAhead. If this year
     142is not supplied with Documentation, GoAhead will supply it upon request.
    60143
    611444.4 No Modifications to Server Identification Field. 
    62145
    63 You agree not to remove or modify the Server identification Field contained in the Response Header as defined in Section 1.6 and 1.7.
     146You agree not to remove or modify the Server identification Field
     147contained in the Response Header as defined in Section 1.6 and 1.7.
    64148
    651495. Warranty Disclaimers.
    66150
    67 THE ORIGINAL CODE, THE DOCUMENTATION AND THE MEDIA UPON WHICH THE ORIGINAL CODE IS RECORDED (IF ANY) ARE PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS, STATUTORY OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
    68 
    69 The entire risk as to the quality and performance of the Original Code (including any Modifications You make) and the Documentation is with You. Should the Original Code or the Documentation prove defective, You (and not GoAhead or its distributors, licensors or dealers) assume the entire cost of all necessary servicing or repair. GoAhead does not warrant that the functions contained in the Original Code will meet your requirements or operate in the combination that You may select for use, that the operation of the Original Code will be uninterrupted or error free, or that defects in the Original Code will be corrected. No oral or written statement by GoAhead or by a representative of GoAhead shall create a warranty or increase the scope of this warranty.
    70 
    71 GOAHEAD DOES NOT WARRANT THE ORIGINAL CODE AGAINST INFRINGEMENT OR THE LIKE WITH RESPECT TO ANY COPYRIGHT, PATENT, TRADE SECRET, TRADEMARK OR OTHER PROPRIETARY RIGHT OF ANY THIRD PARTY AND DOES NOT WARRANT THAT THE ORIGINAL CODE DOES NOT INCLUDE ANY VIRUS, SOFTWARE ROUTINE OR OTHER SOFTWARE DESIGNED TO PERMIT UNAUTHORIZED ACCESS, TO DISABLE, ERASE OR OTHERWISE HARM SOFTWARE, HARDWARE OR DATA, OR TO PERFORM ANY OTHER SUCH ACTIONS.
    72 
    73 Any warranties that by law survive the foregoing disclaimers shall terminate ninety (90) days from the date You received the Original Code.
     151THE ORIGINAL CODE, THE DOCUMENTATION AND THE MEDIA UPON WHICH THE ORIGINAL
     152CODE IS RECORDED (IF ANY) ARE PROVIDED "AS IS" AND WITHOUT WARRANTIES OF
     153ANY KIND, EXPRESS, STATUTORY OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
     154THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     155PURPOSE.
     156
     157The entire risk as to the quality and performance of the Original Code
     158(including any Modifications You make) and the Documentation is with
     159You. Should the Original Code or the Documentation prove defective,
     160You (and not GoAhead or its distributors, licensors or dealers) assume
     161the entire cost of all necessary servicing or repair. GoAhead does not
     162warrant that the functions contained in the Original Code will meet your
     163requirements or operate in the combination that You may select for use,
     164that the operation of the Original Code will be uninterrupted or error
     165free, or that defects in the Original Code will be corrected. No oral
     166or written statement by GoAhead or by a representative of GoAhead shall
     167create a warranty or increase the scope of this warranty.
     168
     169GOAHEAD DOES NOT WARRANT THE ORIGINAL CODE AGAINST INFRINGEMENT OR THE
     170LIKE WITH RESPECT TO ANY COPYRIGHT, PATENT, TRADE SECRET, TRADEMARK
     171OR OTHER PROPRIETARY RIGHT OF ANY THIRD PARTY AND DOES NOT WARRANT
     172THAT THE ORIGINAL CODE DOES NOT INCLUDE ANY VIRUS, SOFTWARE ROUTINE
     173OR OTHER SOFTWARE DESIGNED TO PERMIT UNAUTHORIZED ACCESS, TO DISABLE,
     174ERASE OR OTHERWISE HARM SOFTWARE, HARDWARE OR DATA, OR TO PERFORM ANY
     175OTHER SUCH ACTIONS.
     176
     177Any warranties that by law survive the foregoing disclaimers shall
     178terminate ninety (90) days from the date You received the Original Code.
    74179
    751806. Limitation of Liability.
    76181
    77 YOUR SOLE REMEDIES AND GOAHEAD'S ENTIRE LIABILITY ARE SET FORTH ABOVE. IN NO EVENT WILL GOAHEAD OR ITS DISTRIBUTORS OR DEALERS BE LIABLE FOR DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES RESULTING FROM THE USE OF THE ORIGINAL CODE, THE INABILITY TO USE THE ORIGINAL CODE, OR ANY DEFECT IN THE ORIGINAL CODE, INCLUDING ANY LOST PROFITS, EVEN IF THEY HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    78 
    79 You agree that GoAhead and its distributors and dealers will not be LIABLE for defense or indemnity with respect to any claim against You by any third party arising from your possession or use of the Original Code or the Documentation.
    80 
    81 In no event will GoAhead’s total liability to You for all damages, losses, and causes of action (whether in contract, tort, including negligence, or otherwise) exceed the amount You paid for this product.
    82 
    83 SOME STATES DO NOT ALLOW LIMITATIONS ON HOW LONG AN IMPLIED WARRANTY LASTS, AND SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE LIMITATIONS OR EXCLUSIONS MAY NOT APPLY TO YOU. THIS WARRANTY GIVES YOU SPECIFIC LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS WHICH VARY FROM STATE TO STATE.
     182YOUR SOLE REMEDIES AND GOAHEAD'S ENTIRE LIABILITY ARE SET FORTH ABOVE. IN
     183NO EVENT WILL GOAHEAD OR ITS DISTRIBUTORS OR DEALERS BE LIABLE FOR
     184DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES RESULTING FROM
     185THE USE OF THE ORIGINAL CODE, THE INABILITY TO USE THE ORIGINAL CODE,
     186OR ANY DEFECT IN THE ORIGINAL CODE, INCLUDING ANY LOST PROFITS, EVEN IF
     187THEY HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     188
     189You agree that GoAhead and its distributors and dealers will not be
     190LIABLE for defense or indemnity with respect to any claim against You
     191by any third party arising from your possession or use of the Original
     192Code or the Documentation.
     193
     194In no event will GoAhead’s total liability to You for all damages, losses,
     195and causes of action (whether in contract, tort, including negligence,
     196or otherwise) exceed the amount You paid for this product.
     197
     198SOME STATES DO NOT ALLOW LIMITATIONS ON HOW LONG AN IMPLIED WARRANTY
     199LASTS, AND SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION
     200OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE LIMITATIONS OR
     201EXCLUSIONS MAY NOT APPLY TO YOU. THIS WARRANTY GIVES YOU SPECIFIC LEGAL
     202RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS WHICH VARY FROM STATE TO STATE.
    84203
    852047. Indemnification by You.
    86205
    87 You agree to indemnify and hold GoAhead harmless against any and all claims, losses, damages and costs (including legal expenses and reasonable counsel fees) arising out of any claim of a third party with respect to the contents of the Your products, and any intellectual property rights or other rights or interests related thereto.
     206You agree to indemnify and hold GoAhead harmless against any and all
     207claims, losses, damages and costs (including legal expenses and reasonable
     208counsel fees) arising out of any claim of a third party with respect to
     209the contents of the Your products, and any intellectual property rights
     210or other rights or interests related thereto.
    88211
    892128. High Risk Activities. 
    90213
    91 The Original Code is not fault-tolerant and is not designed , manufactured or intended for use or resale as online control equipment in hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines or weapons systems, in which the failure of the Original Code could lead directly to death, personal injury, or severe physical or environmental damage.  GoAhead and its suppliers specifically disclaim any express or implied warranty of fitness for any high risk uses listed above.
     214The Original Code is not fault-tolerant and is not designed , manufactured
     215or intended for use or resale as online control equipment in hazardous
     216environments requiring fail-safe performance, such as in the operation
     217of nuclear facilities, aircraft navigation or communication systems,
     218air traffic control, direct life support machines or weapons systems,
     219in which the failure of the Original Code could lead directly to death,
     220personal injury, or severe physical or environmental damage.  GoAhead and
     221its suppliers specifically disclaim any express or implied warranty of
     222fitness for any high risk uses listed above.
    92223
    932249. Government Restricted Rights.
    94225
    95 For units of the Department of Defense, use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013. Contractor/manufacturer is GoAhead Software, Inc., 10900 N.E. 8th Street, Suite 750, Bellevue, Washington 98004.
    96 
    97 If the Commercial Computer Software Restricted rights clause at FAR 52.227-19 or its successors apply, the Software and Documentation constitute restricted computer software as defined in that clause and the Government shall not have the license for published software set forth in subparagraph (c)(3) of that clause.
    98 
    99 The Original Code (i) was developed at private expense, and no part of it was developed with governmental funds; (ii) is a trade secret of GoAhead (or its licensor(s)) for all purposes of the Freedom of Information Act; (iii) is "restricted computer software" subject to limited utilization as provided in the contract between the vendor and the governmental entity; and (iv) in all respects is proprietary data belonging solely to GoAhead (or its licensor(s)).
     226For units of the Department of Defense, use, duplication, or disclosure
     227by the Government is subject to restrictions as set forth in subparagraph
     228(c)(1)(ii) of the Rights in Technical Data and Computer Software clause
     229at DFARS 252.227-7013. Contractor/manufacturer is GoAhead Software,
     230Inc., 10900 N.E. 8th Street, Suite 750, Bellevue, Washington 98004.
     231
     232If the Commercial Computer Software Restricted rights clause at FAR
     23352.227-19 or its successors apply, the Software and Documentation
     234constitute restricted computer software as defined in that clause and
     235the Government shall not have the license for published software set
     236forth in subparagraph (c)(3) of that clause.
     237
     238The Original Code (i) was developed at private expense, and no part of it
     239was developed with governmental funds; (ii) is a trade secret of GoAhead
     240(or its licensor(s)) for all purposes of the Freedom of Information Act;
     241(iii) is "restricted computer software" subject to limited utilization as
     242provided in the contract between the vendor and the governmental entity;
     243and (iv) in all respects is proprietary data belonging solely to GoAhead
     244(or its licensor(s)).
    100245
    10124610. Governing Law and Interpretation.
    102247
    103 This Agreement shall be interpreted under and governed by the laws of the State of Washington, without regard to its rules governing the conflict of laws. If any provision of this Agreement is held illegal or unenforceable by a court or tribunal of competent jurisdiction, the remaining provisions of this Agreement shall remain in effect and the invalid provision deemed modified to the least degree necessary to remedy such invalidity.
     248This Agreement shall be interpreted under and governed by the laws of the
     249State of Washington, without regard to its rules governing the conflict of
     250laws. If any provision of this Agreement is held illegal or unenforceable
     251by a court or tribunal of competent jurisdiction, the remaining provisions
     252of this Agreement shall remain in effect and the invalid provision deemed
     253modified to the least degree necessary to remedy such invalidity.
    104254
    10525511. Entire Agreement.
    106256
    107 This Agreement is the complete agreement between GoAhead and You and supersedes all prior agreements, oral or written, with respect to the subject matter hereof.
    108 
    109 If You have any questions concerning this Agreement, You may write to GoAhead Software, Inc., 10900 N.E. 8th Street, Suite 750, Bellevue, Washington 98004 or send e-mail to info@goahead.com.
    110 
    111 BY CLICKING ON THE "Register" BUTTON ON THE REGISTRATION FORM, YOU ACCEPT AND AGREE TO BE BOUND BY ALL OF THE TERMS AND CONDITIONS SET FORTH IN THIS AGREEMENT. IF YOU DO NOT WISH TO ACCEPT THIS LICENSE OR YOU DO NOT QUALIFY FOR A LICENSE BASED ON THE TERMS SET FORTH ABOVE, YOU MUST NOT CLICK THE "Register" BUTTON.
     257This Agreement is the complete agreement between GoAhead and You and
     258supersedes all prior agreements, oral or written, with respect to the
     259subject matter hereof.
     260
     261If You have any questions concerning this Agreement, You may write to
     262GoAhead Software, Inc., 10900 N.E. 8th Street, Suite 750, Bellevue,
     263Washington 98004 or send e-mail to info@goahead.com.
     264
     265BY CLICKING ON THE "Register" BUTTON ON THE REGISTRATION FORM, YOU
     266ACCEPT AND AGREE TO BE BOUND BY ALL OF THE TERMS AND CONDITIONS SET
     267FORTH IN THIS AGREEMENT. IF YOU DO NOT WISH TO ACCEPT THIS LICENSE OR
     268YOU DO NOT QUALIFY FOR A LICENSE BASED ON THE TERMS SET FORTH ABOVE,
     269YOU MUST NOT CLICK THE "Register" BUTTON.
    112270
    113271Exhibit A
  • c/src/libnetworking/rtems_webserver/md5.h

    r2f73363 ree3afa2  
    11/* MD5.H - header file for MD5C.C
     2 *
     3 * $Id$
    24 */
    35
     
    4749
    4850#endif /* _h_MD5 */
     51
  • c/src/libnetworking/rtems_webserver/md5c.c

    r2f73363 ree3afa2  
    11/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
     2 *
     3 * $Id$
    24 */
    35 
  • c/src/libnetworking/rtems_webserver/mime.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    2325 */
    2426
     27
    2528websMimeType websMimeList[] = {
    2629        { T("application/java"), T(".class") },
     
    3336        { T("text/css"), T(".css") },
    3437        { T("text/plain"), T(".txt") },
     38   { T("application/x-javascript"), T(".js") },
    3539
    36 #if MORE_MIME_TYPES
     40#ifdef MORE_MIME_TYPES
    3741        { T("application/binary"), T(".exe") },
    3842        { T("application/compress"), T(".z") },
  • c/src/libnetworking/rtems_webserver/misc.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
    911/********************************* Includes ***********************************/
    1012
    11 #if UEMF
     13#ifdef UEMF
    1214        #include        "uemf.h"
    1315#else
     
    5052static int      dsnprintf(char_t **s, int size, char_t *fmt, va_list arg,
    5153                                int msize);
     54#if !defined(__rtems__)
     55static int      strnlen(char_t *s, unsigned int n);
     56#endif
    5257static void     put_char(strbuf_t *buf, char_t c);
    5358static void     put_string(strbuf_t *buf, char_t *s, int len,
     
    5964/*
    6065 *      "basename" returns a pointer to the last component of a pathname
    61  *  LINUX and LynxOS have their own basename function
    62  */
    63 
    64 #if ! LINUX && ! LYNX && ! __rtems__
     66 *  LINUX, LynxOS and Mac OS X have their own basename function
     67 */
     68
     69#if (!defined (LINUX) && !defined (LYNX) && !defined (MACOSX))
    6570char_t *basename(char_t *name)
    6671{
    6772        char_t  *cp;
    6873
    69 #if NW || WIN
     74#if (defined (NW) || defined (WIN))
    7075        if (((cp = gstrrchr(name, '\\')) == NULL) &&
    7176                        ((cp = gstrrchr(name, '/')) == NULL)) {
     
    8388        }
    8489}
    85 #endif /* ! LINUX & ! LYNX */
     90#endif /* ! LINUX & ! LYNX & ! MACOSX */
    8691
    8792/******************************************************************************/
     
    100105        a_assert(bufsize > 0);
    101106
    102 #if WIN || NW
     107#if (defined (WIN) || defined (NW))
    103108        if ((cp = gstrrchr(name, '/')) == NULL &&
    104109                (cp = gstrrchr(name, '\\')) == NULL)
     
    344349                                                }
    345350                                        } else {
     351                  /* 04 Apr 02 BgP -- changed so that %X correctly outputs
     352                   * uppercase hex digits when requested.
    346353                                                put_ulong(&buf, value, 16, 0, NULL, width, prec, f);
     354                   */
     355                                                put_ulong(&buf, value, 16, ('X' == c) , NULL, width, prec, f);
    347356                                        }
    348357                                }
     
    409418/******************************************************************************/
    410419/*
     420 *      Return the length of a string limited by a given length
     421 */
     422
     423#if !defined(__rtems__)
     424static int strnlen(char_t *s, unsigned int n)
     425{
     426        unsigned int    len;
     427
     428        len = gstrlen(s);
     429        return min(len, n);
     430}
     431#endif
     432
     433/******************************************************************************/
     434/*
    411435 *      Add a character to a string buffer
    412436 */
     
    528552char_t *ascToUni(char_t *ubuf, char *str, int nBytes)
    529553{
    530 #if UNICODE
     554#ifdef UNICODE
    531555        if (MultiByteToWideChar(CP_ACP, 0, str, nBytes / sizeof(char_t), ubuf,
    532556                        nBytes / sizeof(char_t)) < 0) {
     
    534558        }
    535559#else
    536         memcpy(ubuf, str, nBytes);
     560        strncpy(ubuf, str, nBytes);
    537561#endif
    538562        return ubuf;
     
    548572char *uniToAsc(char *buf, char_t *ustr, int nBytes)
    549573{
    550 #if UNICODE
     574#ifdef UNICODE
    551575        if (WideCharToMultiByte(CP_ACP, 0, ustr, nBytes, buf, nBytes, NULL,
    552576                        NULL) < 0) {
     
    554578        }
    555579#else
    556         memcpy(buf, ustr, nBytes);
     580        strncpy(buf, ustr, nBytes);
    557581#endif
    558582        return (char*) buf;
  • c/src/libnetworking/rtems_webserver/ringq.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    4850/********************************* Includes ***********************************/
    4951
    50 #if UEMF
     52#ifdef UEMF
    5153        #include        "uemf.h"
    5254#else
     
    246248
    247249/******************************************************************************/
    248 #if UNICODE
     250#ifdef UNICODE
    249251/*
    250252 *      Get a byte from the queue
     
    539541        bfree(B_L, (char*) rq->buf);
    540542
    541 #if OLD
     543#ifdef OLD
    542544        rq->endp = &newbuf[endp];
    543545        rq->servp = &newbuf[servp];
  • c/src/libnetworking/rtems_webserver/rom.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    2527/******************************** Local Data **********************************/
    2628
    27 #if WEBS_PAGE_ROM
     29#ifdef WEBS_PAGE_ROM
    2830
    2931sym_fd_t        romTab;                                         /* Symbol table for web pages */
  • c/src/libnetworking/rtems_webserver/security.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    8284#ifdef WEBS_SSL_SUPPORT
    8385        nRet = umGetAccessLimitSecure(accessLimit);
    84         if (nRet && ((flags | WEBS_SECURE) == 0)) {
     86        if (nRet && ((flags & WEBS_SECURE) == 0)) {
    8587                websStats.access++;
    86                 websError(wp, 200, T("Access Denied\nSecure access is required."));
     88                websError(wp, 405, T("Access Denied\nSecure access is required."));
    8789                trace(3, T("SEC: Non-secure access attempted on <%s>\n"), path);
     90      /* bugfix 5/24/02 -- we were leaking the memory pointed to by
     91       * 'accessLimit'. Thanks to Simon Byholm.
     92       */
     93      bfree(B_L, accessLimit);
    8894                return 1;
    8995        }
     
    110116                if (!umUserExists(userid)) {
    111117                        websStats.access++;
    112                         websError(wp, 200, T("Access Denied\nUnknown User"));
     118                        websError(wp, 401, T("Access Denied\nUnknown User"));
    113119                        trace(3, T("SEC: Unknown user <%s> attempted to access <%s>\n"),
    114120                                userid, path);
     
    123129                                if (gstrcmp(password, userpass) != 0) {
    124130                                        websStats.access++;
    125                                         websError(wp, 200, T("Access Denied\nWrong Password"));
     131                                        websError(wp, 401, T("Access Denied\nWrong Password"));
    126132                                        trace(3, T("SEC: Password fail for user <%s>")
    127133                                                                T("attempt to access <%s>\n"), userid, path);
     
    154160                        if (gstrcmp(wp->digest, digestCalc) != 0) {
    155161                                websStats.access++;
    156                                 websError(wp, 200, T("Access Denied\nWrong Password"));
     162                                websError(wp, 405, T("Access Denied\nWrong Password"));
    157163                                nRet = 1;
    158164                        }
  • c/src/libnetworking/rtems_webserver/sock.c

    r2f73363 ree3afa2  
    33 *
    44 * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
     5 *
     6 * $Id$
    57 */
    68
     
    1719#include        <stdlib.h>
    1820
    19 #if UEMF
     21#ifdef UEMF
    2022        #include        "uemf.h"
    2123#else
     
    7173                        if ((room = ringqPutBlkMax(rq)) == 0) {
    7274                                if (sp->flags & SOCKET_BLOCK) {
    73 #if WIN || CE
     75#if (defined (WIN) || defined (CE))
    7476                                        int             errCode;
    7577                                        if (! socketWaitForEvent(sp,  FD_WRITE | SOCKET_WRITABLE,
     
    100102int     socketWriteString(int sid, char_t *buf)
    101103{
    102  #if UNICODE
     104 #ifdef UNICODE
    103105        char    *byteBuf;
    104106        int             r, len;
     
    248250                        len = ringqLen(lq);
    249251                        if (len > 0) {
    250                                 *buf = ballocAscToUni(lq->servp, len);
     252                                *buf = ballocAscToUni((char *)lq->servp, len);
    251253                        } else {
    252254                                *buf = NULL;
     
    299301                                continue;
    300302                        } else if (errCode == EWOULDBLOCK || errCode == EAGAIN) {
    301 #if WIN || CE
     303#if (defined (WIN) || defined (CE))
    302304                                if (sp->flags & SOCKET_BLOCK) {
    303305                                        int             errCode;
     
    479481        *errCode = 0;
    480482
    481 #if WIN || CE
     483#if (defined (WIN) || defined (CE))
    482484        if ((sp->flags & SOCKET_ASYNC)
    483485                        && ! socketWaitForEvent(sp,  FD_CONNECT, errCode)) {
     
    491493        if (sp->flags & SOCKET_BROADCAST) {
    492494                server.sin_family = AF_INET;
    493 #if UEMF || LITTLEFOOT
     495#if (defined (UEMF) || defined (LITTLEFOOT))
    494496                server.sin_addr.s_addr = INADDR_BROADCAST;
    495497#else
     
    515517        if (bytes < 0) {
    516518                *errCode = socketGetError();
    517 #if WIN || CE
     519#if (defined (WIN) || defined (CE))
    518520                sp->currentEvents &= ~FD_WRITE;
    519521#endif
     
    523525        } else if (bytes == 0 && bytes != toWrite) {
    524526                *errCode = EWOULDBLOCK;
    525 #if WIN || CE
     527#if (defined (WIN) || defined (CE))
    526528                sp->currentEvents &= ~FD_WRITE;
    527529#endif
     
    533535 *      more data
    534536 */
    535 #if !UEMF
    536 #if WIN
     537#ifndef UEMF
     538#ifdef WIN
    537539        if (sp->interestEvents & FD_WRITE) {
    538540                emfTime_t blockTime = { 0, 0 };
     
    554556                        struct sockaddr *server)
    555557{
    556 #if VXWORKS
     558#ifdef VXWORKS
    557559        char *ptr;
    558560
     
    639641                        recv(sp->sock, buf, sizeof(buf), 0);
    640642                }
    641 #if WIN || CE
     643#if (defined (WIN) || defined (CE))
    642644                closesocket(sp->sock);
    643645#else
     
    689691int socketGetError()
    690692{
    691 #if WIN || CE
     693#if (defined (WIN) || defined (CE))
    692694        switch (WSAGetLastError()) {
    693695        case WSAEWOULDBLOCK:
  • c/src/libnetworking/rtems_webserver/sym.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    1719/********************************* Includes ***********************************/
    1820
    19 #if UEMF
     21#ifdef UEMF
    2022        #include        "uemf.h"
    2123#else
  • c/src/libnetworking/rtems_webserver/uemf.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    4749        if (etype == E_LOG) {
    4850                fmtAlloc(&buf, E_MAX_ERROR, T("%s\n"), fmtBuf);
    49 #if DEV
     51/*#ifdef DEV*/
    5052        } else if (etype == E_ASSERT) {
    5153                fmtAlloc(&buf, E_MAX_ERROR,
    5254                        T("Assertion %s, failed at %s %d\n"), fmtBuf, E_ARGS);
    53 #endif
     55/*#endif*/
    5456        } else if (etype == E_USER) {
    5557                fmtAlloc(&buf, E_MAX_ERROR, T("%s\n"), fmtBuf);
    5658        }
     59   /*
     60    * bugfix -- if etype is not E_LOG, E_ASSERT, or E_USER, the call to
     61    * bfreeSafe(B_L, buf) below will fail, because 'buf' is randomly
     62    * initialized. To be nice, we format a message saying that this is an
     63    * unknown message type, and in doing so give buf a valid value. Thanks
     64    * to Simon Byholm.
     65    */
     66   else {
     67      fmtAlloc(&buf, E_MAX_ERROR, T("Unknown error"));
     68   }
    5769        va_end(args);
    5870
  • c/src/libnetworking/rtems_webserver/uemf.h

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    1820/******************************* Per O/S Includes *****************************/
    1921
    20 #if WIN
     22#ifdef WIN
    2123        #include        <direct.h>
    2224        #include        <io.h>
     
    3436#endif /* WIN */
    3537
    36 #if CE
     38#ifdef CE
     39        #include        <errno.h>
    3740        #include        <limits.h>
    3841        #include        <tchar.h>
    3942        #include        <windows.h>
     43        #include        <winsock.h>
    4044        #include        <winnls.h>
    4145        #include        "CE/wincompat.h"
     
    4347#endif /* CE */
    4448
    45 #if NW
     49#ifdef NW
     50        #include        <direct.h>
     51        #include        <io.h>
     52        #include        <sys/stat.h>
     53        #include        <time.h>
     54        #include        <sys/types.h>
    4655        #include        <stdio.h>
     56        #include        <stdlib.h>
     57        #include        <fcntl.h>
     58        #include        <errno.h>
     59        #include        <niterror.h>
     60        #define         EINTR EINUSE
     61        #define          WEBS   1
     62        #include        <limits.h>
     63        #include        <netdb.h>
     64        #include        <process.h>
     65        #include        <tiuser.h>
     66        #include        <sys/time.h>
     67        #include        <arpa/inet.h>
     68        #include        <sys/types.h>
     69        #include        <sys/socket.h>
     70        #include        <sys/filio.h>
     71        #include        <netinet/in.h>
    4772#endif /* NW */
    4873
    49 #if SCOV5
     74#ifdef SCOV5
    5075        #include        <sys/types.h>
    5176        #include        <stdio.h>
     
    5782#endif /* SCOV5 */
    5883
    59 #if UNIX
     84#ifdef UNIX
    6085        #include        <stdio.h>
    6186#endif /* UNIX */
     
    79104#endif /* LINUX */
    80105
    81 #if LYNX
     106#ifdef LYNX
    82107        #include        <limits.h>
    83108        #include        <stdarg.h>
     
    94119#endif /* LYNX */
    95120
    96 #if UW
     121#ifdef MACOSX
     122        #include        <sys/stat.h>
     123        #include        <stdio.h>
     124        #include        <stdlib.h>
     125        #include        <unistd.h>
     126        #include        <sys/socket.h>
     127        #include        <netinet/in.h>
     128        #include        <arpa/inet.h>
     129        #include        <netdb.h>
     130        #include        <fcntl.h>
     131        #include        <errno.h>
     132#endif /* MACOSX */
     133
     134#ifdef UW
    97135        #include        <stdio.h>
    98136#endif /* UW */
    99137
    100 #if VXWORKS
     138#ifdef VXWORKS
    101139        #include        <vxWorks.h>
    102140        #include        <sockLib.h>
     
    112150#endif /* VXWORKS */
    113151
    114 #if SOLARIS
     152#ifdef SOLARIS
    115153        #include        <sys/types.h>
    116154        #include        <limits.h>
     
    128166#endif /* SOLARIS */
    129167
    130 #if QNX4
     168#ifdef QNX4
    131169        #include        <sys/types.h>
    132170        #include        <stdio.h>
     
    142180#endif /* QNX4 */
    143181
    144 #if ECOS
     182#ifdef ECOS
    145183        #include        <limits.h>
    146184        #include        <cyg/infra/cyg_type.h>
     
    157195#include        <string.h>
    158196
    159 #if ! WEBS
     197#ifndef WEBS
    160198#include        "messages.h"
    161199#endif /* ! WEBS */
     
    167205#endif
    168206
    169 #if UW
     207#ifdef UW
    170208        #define         __NO_PACK               1
    171209#endif /* UW */
    172210
    173 #if SCOV5 || VXWORKS || LINUX || LYNX || __rtems__
     211#if (defined (SCOV5) || defined (VXWORKS) || defined (LINUX) || defined (LYNX) || defined (MACOSX) || defined (__rtems__))
    174212#ifndef O_BINARY
    175213#define O_BINARY                0
    176214#endif /* O_BINARY */
    177215#define SOCKET_ERROR    -1
    178 #endif /* SCOV5 || VXWORKS || LINUX || LYNX */
    179 
    180 #if WIN || CE
     216#endif /* SCOV5 || VXWORKS || LINUX || LYNX || MACOSX */
     217
     218#if (defined (WIN) || defined (CE))
    181219/*
    182220 *      __NO_FCNTL means can't access fcntl function.  Fcntl.h is still available.
     
    194232#endif /* WIN || CE */
    195233
    196 #if LINUX && !__rtems__ && ! _STRUCT_TIMEVAL
     234#if (defined (LINUX) && !defined(__rtems__) && !defined (_STRUCT_TIMEVAL))
    197235struct timeval
    198236{
     
    203241#endif /* LINUX && ! _STRUCT_TIMEVAL */
    204242
    205 #if ECOS
     243#ifdef ECOS
    206244        #define         O_RDONLY                1
    207245        #define         O_BINARY                2
     
    219257#endif /* ECOS */
    220258
    221 #if QNX4
     259#ifdef QNX4
    222260    typedef long        fd_mask;
    223261    #define NFDBITS (sizeof (fd_mask) * NBBY)   /* bits per mask */
    224262#endif /* QNX4 */
     263
     264#ifdef NW
     265        #define fd_mask                 fd_set
     266        #define INADDR_NONE             -1l
     267        #define Sleep                   delay
     268
     269        #define __NO_FCNTL              1
     270
     271        #undef R_OK
     272        #define R_OK    4
     273        #undef W_OK
     274        #define W_OK    2
     275        #undef X_OK
     276        #define X_OK    1
     277        #undef F_OK
     278        #define F_OK    0
     279#endif /* NW */
    225280
    226281/********************************** Unicode ***********************************/
     
    234289#define XML_MAX                         4096                    /* Maximum size for tags/tokens */
    235290#define BUF_MAX                         4096                    /* General sanity check for bufs */
    236 
    237 #if LITTLEFOOT || WEBS
     291#define FMT_STATIC_MAX          256                             /* Maximum for fmtStatic calls */
     292
     293#if (defined (LITTLEFOOT) || defined (WEBS))
    238294#define LF_BUF_MAX              (510)
    239295#define LF_PATHSIZE             LF_BUF_MAX
     
    246302#ifndef CHAR_T_DEFINED
    247303#define CHAR_T_DEFINED 1
    248 #if UNICODE
     304#ifdef UNICODE
    249305/*
    250306 *      To convert strings to UNICODE. We have a level of indirection so things
     
    272328#define TSZ(x)                          (sizeof(x))
    273329#define TASTRL(x)                       (strlen(x) + 1)
    274 #if WIN
     330#ifdef WIN
    275331typedef unsigned char           uchar_t;
    276332#endif /* WIN */
     
    302358 *      here, many modules in various parts of the tree are cleaner.
    303359 */
    304 #if LITTLEFOOT && INMEM
     360#if (defined (LITTLEFOOT) && defined (INMEM))
    305361        #include        "lf/inmem.h"
    306362#endif /* LITTLEFOOT && INMEM */
     
    309365 *      Type for unicode systems
    310366 */
    311 #if UNICODE
     367#ifdef UNICODE
    312368
    313369#define gmain           wmain
     
    368424#define gtolower        towlower
    369425#define gtoupper        towupper
    370 #if CE
     426#ifdef CE
    371427#define gisspace        isspace
    372428#define gisdigit        isdigit
     
    395451#ifndef gopen
    396452#if INMEM
     453#define gchdir          imChdir
     454#define gmkdir          imMkdir
     455#define grmdir          imRmdir
    397456#define gclose          imClose
    398457#define gclosedir       imClosedir
    399 #define gchdir          imChdir
    400458#define gchmod          imChmod
    401459#define ggetcwd         imGetcwd
    402460#define glseek          imLseek
    403461#define gloadModule     imLoadModule
    404 #define gmkdir          imMkdir
    405462#define gopen           imOpen
    406463#define gopendir        imOpendir
     
    408465#define greaddir        imReaddir
    409466#define grename         imRename
    410 #define grmdir          imRmdir
    411467#define gstat           imStat
    412468#define gunlink         imUnlink
    413469#define gwrite          imWrite
    414470#else
    415 #define gclose          close
    416 #define gclosedir       closedir
    417471#if VXWORKS
    418472#define gchdir          vxchdir
    419473#define gmkdir          vxmkdir
    420474#define grmdir          vxrmdir
     475#elif (defined (LYNX) || defined (LINUX) || defined (MACOSX) || defined (SOLARIS))
     476#define gchdir          chdir
     477#define gmkdir(s)       mkdir(s,0755)
     478#define grmdir          rmdir
    421479#else
    422 #if LYNX || LINUX || SOLARIS
    423 #define gmkdir(s)       mkdir(s,0755)
    424 #else
     480#define gchdir          chdir
    425481#define gmkdir          mkdir
    426 #endif /* LYNX || LINUX || SOLARIS */
    427482#define grmdir          rmdir
    428 #define gchdir          chdir
    429 #endif /* VXWORKS */
     483#endif /* VXWORKS #elif LYNX || LINUX || MACOSX || SOLARIS*/
     484#define gclose          close
     485#define gclosedir       closedir
    430486#define gchmod          chmod
    431487#define ggetcwd         getcwd
     
    501557#define gmain           main
    502558#endif /* ! VXWORKS */
    503 #if VXWORKS
     559#ifdef VXWORKS
    504560#define fcntl(a, b, c)
    505561#endif /* VXWORKS */
    506562#endif /* ! UNICODE */
    507563
     564/*
     565 *      Include inmem.h here because it redefines many of the file access fucntions.
     566 *      Otherwise there would be lots more #if-#elif-#else-#endif ugliness.
     567 */
     568#ifdef INMEM
     569        #include        "lf/inmem.h"
     570#endif
     571
    508572/********************************** Defines ***********************************/
    509573
     
    526590#define E_ARGS                          file, line
    527591
    528 #if ASSERT || ASSERT_CE
     592#if (defined (ASSERT) || defined (ASSERT_CE))
    529593        #define a_assert(C)             if (C) ; else error(E_L, E_ASSERT, T("%s"), T(#C))
    530594#else
     
    571635                long    octal;
    572636                long    big[2];
    573 #if FLOATING_POINT_SUPPORT
     637#ifdef FLOATING_POINT_SUPPORT
    574638                double  floating;
    575639#endif /* FLOATING_POINT_SUPPORT */
     
    580644        } value;
    581645
    582         vtype_t                 type            : 16;
     646        vtype_t                 type;
    583647        unsigned int    valid           : 8;
    584648        unsigned int    allocated       : 8;            /* String was balloced */
     
    750814 */
    751815
    752 #if (WIN || CE) && WEBS
     816#if ((defined (WIN) || defined (CE)) && defined (WEBS))
    753817#define EWOULDBLOCK             WSAEWOULDBLOCK
    754818#define ENETDOWN                WSAENETDOWN
     
    756820#endif /* (WIN || CE) && WEBS) */
    757821
    758 #define SOCKET_EOF                              0x1                     /* Seen end of file */
    759 #define SOCKET_CONNECTING               0x2                     /* Connect in progress */
    760 #define SOCKET_BROADCAST                0x4                     /* Broadcast mode */
    761 #define SOCKET_PENDING                  0x8                     /* Message pending on this socket */
    762 #define SOCKET_FLUSHING                 0x10            /* Background flushing */
    763 #define SOCKET_DATAGRAM                 0x20            /* Use datagrams */
    764 #define SOCKET_ASYNC                    0x40            /* Use async connect */
    765 #define SOCKET_BLOCK                    0x80            /* Use blocking I/O */
    766 #define SOCKET_LISTENING                0x100           /* Socket is server listener */
    767 #define SOCKET_CLOSING                  0x200           /* Socket is closing */
    768 
    769 #define SOCKET_PORT_MAX                 0xffff          /* Max Port size */
     822#define SOCKET_EOF                              0x1             /* Seen end of file */
     823#define SOCKET_CONNECTING               0x2             /* Connect in progress */
     824#define SOCKET_BROADCAST                0x4             /* Broadcast mode */
     825#define SOCKET_PENDING                  0x8             /* Message pending on this socket */
     826#define SOCKET_FLUSHING                 0x10    /* Background flushing */
     827#define SOCKET_DATAGRAM                 0x20    /* Use datagrams */
     828#define SOCKET_ASYNC                    0x40    /* Use async connect */
     829#define SOCKET_BLOCK                    0x80    /* Use blocking I/O */
     830#define SOCKET_LISTENING                0x100   /* Socket is server listener */
     831#define SOCKET_CLOSING                  0x200   /* Socket is closing */
     832#define SOCKET_CONNRESET                0x400   /* Socket connection was reset */
     833
     834#define SOCKET_PORT_MAX                 0xffff  /* Max Port size */
    770835
    771836/*
    772837 *      Socket error values
    773838 */
    774 #define SOCKET_WOULDBLOCK               1                       /* Socket would block on I/O */
    775 #define SOCKET_RESET                    2                       /* Socket has been reset */
    776 #define SOCKET_NETDOWN                  3                       /* Network is down */
    777 #define SOCKET_AGAIN                    4                       /* Issue the request again */
    778 #define SOCKET_INTR                             5                       /* Call was interrupted */
    779 #define SOCKET_INVAL                    6                       /* Invalid */
     839#define SOCKET_WOULDBLOCK               1               /* Socket would block on I/O */
     840#define SOCKET_RESET                    2               /* Socket has been reset */
     841#define SOCKET_NETDOWN                  3               /* Network is down */
     842#define SOCKET_AGAIN                    4               /* Issue the request again */
     843#define SOCKET_INTR                             5               /* Call was interrupted */
     844#define SOCKET_INVAL                    6               /* Invalid */
    780845
    781846/*
    782847 *      Handler event masks
    783848 */
    784 #define SOCKET_READABLE                 0x2                     /* Make socket readable */
    785 #define SOCKET_WRITABLE                 0x4                     /* Make socket writable */
    786 #define SOCKET_EXCEPTION                0x8                     /* Interested in exceptions */
     849#define SOCKET_READABLE                 0x2             /* Make socket readable */
     850#define SOCKET_WRITABLE                 0x4             /* Make socket writable */
     851#define SOCKET_EXCEPTION                0x8             /* Interested in exceptions */
    787852#define EMF_SOCKET_MESSAGE              (WM_USER+13)
    788853
    789 #if LITTLEFOOT
    790 #define SOCKET_BUFSIZ                   510                     /* Underlying buffer size */
     854#ifdef LITTLEFOOT
     855#define SOCKET_BUFSIZ                   510             /* Underlying buffer size */
    791856#else
    792 #define SOCKET_BUFSIZ                   1024            /* Underlying buffer size */
     857#define SOCKET_BUFSIZ                   1024    /* Underlying buffer size */
    793858#endif /* LITTLEFOOT */
    794859
     
    831896 */
    832897
    833 #if NO_BALLOC
     898#ifdef NO_BALLOC
    834899#define balloc(B_ARGS, num) malloc(num)
    835900#define bfree(B_ARGS, p) free(p)
     
    852917#define bstrdup(B_ARGS, p) bstrdup(p)
    853918
    854 #if UNICODE
     919#ifdef UNICODE
    855920#define bstrdupA(B_ARGS, p) bstrdupA(p)
    856921#else /* UNICODE */
     
    867932extern char_t   *bstrdup(B_ARGS_DEC, char_t *s);
    868933
    869 #if UNICODE
     934#ifdef UNICODE
    870935extern char *bstrdupA(B_ARGS_DEC, char *s);
    871936#else /* UNICODE */
     
    882947#define B_USER_BUF                      0x2                             /* User supplied buffer for mem */
    883948
     949
    884950#if !LINUX && !__rtems__
    885951extern char_t   *basename(char_t *name);
    886952#endif /* !LINUX */
    887953
    888 #if UEMF && WEBS
     954#if (defined (UEMF) && defined (WEBS))
    889955/*
    890956 *      The open source webserver uses a different callback/timer mechanism
     
    909975                                        (int etype, char_t *msg);
    910976
    911 #if B_STATS
     977#ifdef B_STATS
    912978#define                 hAlloc(x)                               HALLOC(B_L, x)
    913979#define                 hAllocEntry(x, y, z)    HALLOCENTRY(B_L, x, y, z)
     
    9341000extern int              fmtStatic(char_t *s, int n, char_t *fmt, ...);
    9351001
    936 #if UNICODE
     1002#ifdef UNICODE
    9371003extern int              ringqPutcA(ringq_t *rq, char c);
    9381004extern int              ringqInsertcA(ringq_t *rq, char c);
  • c/src/libnetworking/rtems_webserver/um.c

    r2f73363 ree3afa2  
    5454/******************************** Local Data **********************************/
    5555
     56#ifdef qHierarchicalAccess
     57/*
     58 * user-provided function to allow hierarchical access protection. See below.
     59 * for details.
     60 */
     61extern bool_t dmfCanAccess(const char_t* usergroup, const char_t* group);
     62#endif
    5663#ifdef UEMF
    5764/*
     
    13781385 */
    13791386        if (group && *group) {
     1387#ifdef qHierarchicalAccess
     1388      /*
     1389       * If we are compiling with the hierarchical access extensions, we
     1390       * instead call the user-provided function that checks to see whether
     1391       * the current user's access level is greater than or equal to the
     1392       * access level required for this URL.
     1393       */
     1394      return dmfCanAccess(usergroup, group);
     1395
     1396#else
    13801397                if (usergroup && (gstrcmp(group, usergroup) != 0)) {
    13811398                        return FALSE;
     1399
    13821400                }
     1401#endif
    13831402        }
    13841403
     
    13871406 */
    13881407        return TRUE;
     1408
    13891409}
    13901410
  • c/src/libnetworking/rtems_webserver/um.h

    r2f73363 ree3afa2  
    2222/********************************* Includes ***********************************/
    2323
    24 #if ! UEMF
     24#ifndef UEMF
    2525        #include        "basic/basic.h"
    2626        #include        "emf/emf.h"
  • c/src/libnetworking/rtems_webserver/url.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
  • c/src/libnetworking/rtems_webserver/value.c

    r2f73363 ree3afa2  
    33 *
    44 * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
     5 *
     6 * $Id$
    57 */
    68
     
    1416/********************************* Includes ***********************************/
    1517
    16 #if UEMF
     18#ifdef UEMF
    1719        #include        "uemf.h"
    1820#else
     
    2123
    2224/*********************************** Locals ***********************************/
    23 #if !UEMF
     25#ifndef UEMF
    2426static value_t value_null;                                      /* All zeros */
    2527
     
    7880                bfree(B_L, v->value.string);
    7981        }
    80 #if !UEMF
     82#ifndef UEMF
    8183        if (v->valid && v->type == symbol && v->value.symbol.data != NULL &&
    8284                        v->value.symbol.freeCb !=NULL) {
     
    8991}
    9092
    91 #if !UEMF
     93#ifndef UEMF
    9294
    9395/******************************************************************************/
     
    152154}
    153155
    154 #if FLOATING_POINT_SUPPORT
     156#ifdef FLOATING_POINT_SUPPORT
    155157/******************************************************************************/
    156158/*
     
    337339                break;
    338340
    339 #if FLOATING_POINT_SUPPORT
     341#ifdef FLOATING_POINT_SUPPORT
    340342        case floating:
    341343                v1.value.floating += v2.value.floating;
     
    394396                break;
    395397
    396 #if FLOATING_POINT_SUPPORT
     398#ifdef FLOATING_POINT_SUPPORT
    397399        case floating:
    398400                v1.value.floating -= v2.value.floating;
     
    455457                break;
    456458
    457 #if FLOATING_POINT_SUPPORT
     459#ifdef FLOATING_POINT_SUPPORT
    458460        case floating:
    459461                v1.value.floating *= v2.value.floating;
     
    512514                break;
    513515
    514 #if FLOATING_POINT_SUPPORT
     516#ifdef FLOATING_POINT_SUPPORT
    515517        case floating:
    516518                v1.value.floating /= v2.value.floating;
     
    583585                else return 1;
    584586
    585 #if FLOATING_POINT_SUPPORT
     587#ifdef FLOATING_POINT_SUPPORT
    586588        case floating:
    587589                if (v1.value.floating < v2.value.floating)
     
    634636static void coerce_types(register value_t* v1, register value_t* v2)
    635637{
    636 #if FLOATING_POINT_SUPPORT
     638#ifdef FLOATING_POINT_SUPPORT
    637639        if (v1->type == floating) {
    638640                v2->type = floating;
     
    701703                return 0;
    702704
    703 #if FLOATING_POINT_SUPPORT
     705#ifdef FLOATING_POINT_SUPPORT
    704706        case floating:
    705707                if (vp->value.floating < 0)
     
    751753                return 0;
    752754
    753 #if FLOATING_POINT_SUPPORT
     755#ifdef FLOATING_POINT_SUPPORT
    754756        case floating:
    755757                if (vp->value.floating == 0)
     
    802804        case bytes:
    803805        case big:
    804 #if FLOATING_POINT_SUPPORT
     806#ifdef FLOATING_POINT_SUPPORT
    805807        case floating:
    806808                a_assert(0);
     
    853855                break;
    854856
    855 #if FLOATING_POINT_SUPPORT
     857#ifdef FLOATING_POINT_SUPPORT
    856858        case floating:
    857859                if (fmt == NULL || *fmt == '\0') {
     
    962964                break;
    963965
    964 #if UNUSED
     966#ifdef UNUSED
    965967        case bytes:
    966968                asrc = vp.value.bytes;
     
    11691171                break;
    11701172
    1171 #if FLOATING_POINT_SUPPORT
     1173#ifdef FLOATING_POINT_SUPPORT
    11721174        case floating:
    11731175                gsscanf(s, T("%f"), &v.value.floating);
     
    11921194                break;
    11931195
    1194 #if UNUSED
     1196#ifdef UNUSED
    11951197        case literal:
    11961198                v = value_literal(bstrdup(B_L, s));
  • c/src/libnetworking/rtems_webserver/wbase64.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
  • c/src/libnetworking/rtems_webserver/webcomp.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    113115                        return -1;
    114116                }
    115                 fprintf(stdout, "static const unsigned char page_%d[] = {\n", nFile);
     117                fprintf(stdout, "static unsigned char page_%d[] = {\n", nFile);
    116118
    117119                while ((len = read(fd, buf, sizeof(buf))) > 0) {
  • c/src/libnetworking/rtems_webserver/webpage.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    2830        a_assert(websValid(wp));
    2931
    30 #if WEBS_PAGE_ROM
     32#ifdef WEBS_PAGE_ROM
    3133        return websRomPageOpen(wp, path, mode, perm);
    3234#else
     
    4446        a_assert(websValid(wp));
    4547
    46 #if WEBS_PAGE_ROM
     48#ifdef WEBS_PAGE_ROM
    4749        websRomPageClose(wp->docfd);
    4850#else
     
    6163int websPageStat(webs_t wp, char_t *lpath, char_t *path, websStatType* sbuf)
    6264{
    63 #if WEBS_PAGE_ROM
     65#ifdef WEBS_PAGE_ROM
    6466        return websRomPageStat(path, sbuf);
    6567#else
     
    8385int websPageIsDirectory(char_t *lpath)
    8486{
    85 #if WEBS_PAGE_ROM
     87#ifdef WEBS_PAGE_ROM
    8688        websStatType    sbuf;
    8789
     
    112114{
    113115
    114 #if WEBS_PAGE_ROM
     116#ifdef WEBS_PAGE_ROM
    115117        a_assert(websValid(wp));
    116118        return websRomPageReadData(wp, buf, nBytes);
     
    130132        a_assert(websValid(wp));
    131133
    132 #if WEBS_PAGE_ROM
     134#ifdef WEBS_PAGE_ROM
    133135        websRomPageSeek(wp, offset, SEEK_CUR);
    134136#else
  • c/src/libnetworking/rtems_webserver/webrom.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
  • c/src/libnetworking/rtems_webserver/webs.c

    r2f73363 ree3afa2  
    2020#include        "wsIntrn.h"
    2121#ifdef DIGEST_ACCESS_SUPPORT
    22 #include        "websda.h"
     22        #include        "websda.h"
    2323#endif
    2424
     
    4545        { 301, T("Redirect") },
    4646        { 302, T("Redirect") },
    47         { 304, T("User local copy") },
     47        { 304, T("Use local copy") },
    4848        { 400, T("Page not found") },
    4949        { 401, T("Unauthorized") },
     
    5757};
    5858
    59 #if WEBS_LOG_SUPPORT
     59#ifdef WEBS_LOG_SUPPORT
    6060static char_t   websLogname[64] = T("log.txt"); /* Log filename */
    6161static int              websLogFd;                                              /* Log file handle */
     
    7070
    7171
    72 static char_t   *websErrorMsg(int code);
     72/*static char_t         *websErrorMsg(int code);*/
    7373static int              websGetInput(webs_t wp, char_t **ptext, int *nbytes);
    7474static int              websParseFirst(webs_t wp, char_t *text);
     
    7777static int              websGetTimeSinceMark(webs_t wp);
    7878
    79 #if WEBS_LOG_SUPPORT
     79#ifdef WEBS_LOG_SUPPORT
    8080static void     websLog(webs_t wp, int code);
    8181#endif
    82 #if WEBS_IF_MODIFIED_SUPPORT
     82#ifdef WEBS_IF_MODIFIED_SUPPORT
    8383static time_t   dateParse(time_t tip, char_t *cmd);
    8484#endif
     
    100100        a_assert(retries >= 0);
    101101
    102 #if WEBS_PAGE_ROM
     102#ifdef WEBS_PAGE_ROM
    103103        websRomOpen();
    104104#endif
     
    124124        websFormOpen();
    125125
    126 #if WEBS_LOG_SUPPORT
     126#ifdef WEBS_LOG_SUPPORT
    127127/*
    128128 *      Optional request log support
     
    166166        }
    167167
    168 #if WEBS_LOG_SUPPORT
     168#ifdef WEBS_LOG_SUPPORT
    169169        if (websLogFd >= 0) {
    170170                close(websLogFd);
     
    173173#endif
    174174
    175 #if WEBS_PAGE_ROM
     175#ifdef WEBS_PAGE_ROM
    176176        websRomClose();
    177177#endif
     
    273273        wp->listenSid = listenSid;
    274274
    275         ascToUni(wp->ipaddr, ipaddr, sizeof(wp->ipaddr));
     275        ascToUni(wp->ipaddr, ipaddr, min(sizeof(wp->ipaddr), strlen(ipaddr) + 1));
    276276
    277277/*
     
    320320        }
    321321        if (mask & SOCKET_WRITABLE) {
    322                 if (wp->writeSocket) {
     322                if (websValid(wp) && wp->writeSocket) {
    323323                        (*wp->writeSocket)(wp);
    324324                }
     
    341341        a_assert(websValid(wp));
    342342
    343         websMarkTime(wp);
     343        websSetTimeMark(wp);
    344344
    345345/*
     
    411411                                }
    412412                                gwrite(fd, text, gstrlen(text));
    413                                 gwrite(fd, T("\n"), sizeof(char_t));
     413            /*
     414             * NOTE that the above comment is wrong -- if the content length
     415             * is set, websGetInput() does NOT use socketGets(), it uses
     416             * socketRead(), so the line below that adds an additional newline
     417             * is destructive.
     418             */
     419                                /*gwrite(fd, T("\n"), sizeof(char_t));*/
     420/*
     421 *                              Line removed as per BUG02488
     422 *
    414423                                nbytes += 1;
     424 */
    415425                        } else
    416426#endif
     
    434444 *                                      append it.
    435445 */
    436                                         len = gstrlen(wp->query);
    437                                         wp->query = brealloc(B_L, wp->query, (len +     gstrlen(text) +
    438                                                 1) * sizeof(char_t));
    439                                         if (wp->query) {
    440                                                 gstrcpy(&wp->query[len], text);
    441                                         }
     446               if (text != NULL)
     447               {
     448                  len = gstrlen(wp->query);
     449                  wp->query = brealloc(B_L, wp->query, (len +   gstrlen(text) +
     450                     1) * sizeof(char_t));
     451                  if (wp->query) {
     452                     gstrcpy(&wp->query[len], text);
     453                  }
     454               }
    442455                                }
    443456
     
    458471                        }
    459472/*
    460  *                      No more data so process the request
    461  */
     473 *                      No more data so process the request, (but be sure to close
     474 *                      the input file first!).
     475 */
     476                        if (fd != -1) {
     477                                gclose (fd);
     478                                fd = -1;
     479                        }
    462480                        websUrlHandlerRequest(wp);
    463481                        done++;
     
    625643                                        websDone(wp, 0);
    626644                                }
     645                        } else {
     646/*
     647 *                              If an error occurred and it wasn't an eof, close the connection
     648 */
     649#ifdef HP_FIX
     650                                websDone(wp, 0);
     651#endif /*HP_FIX*/
     652
    627653                        }
    628654/*
     
    631657 *                      no empty line terminator.
    632658 */
     659/*
     660 *                      NOTE: this fix for earlier versions of browsers is troublesome
     661 *                      because if we don't receive the entire header in the first pass
     662 *                      this code assumes we were only expecting a one line header, which
     663 *                      is not necessarily the case. So we weren't processing the whole
     664 *                      header and weren't fufilling requests properly.
     665 */
     666#ifdef UNUSED
    633667                        if (wp->state == WEBS_HEADER && ringqLen(&wp->header) <= 0) {
    634668                                websParseRequest(wp);
    635669                                websUrlHandlerRequest(wp);
    636670                        }
     671#endif
    637672                        return -1;
    638673
     
    762797        websUrlType(url, wp->type, TSZ(wp->type));
    763798
    764 #if WEBS_PROXY_SUPPORT
     799#ifdef WEBS_PROXY_SUPPORT
    765800/*
    766801 *      Determine if this is a request for local webs data. If it is not a proxied
     
    873908                                if ((cp = gstrchr(value, ' ')) != NULL) {
    874909                                        *cp = '\0';
     910               /*
     911                * bugfix 5/24/02 -- we were leaking the memory pointed to by
     912                * wp->authType that was allocated just before the if()
     913                * statement that we are currently in. Thanks to Simon Byholm.
     914                */
     915               bfree(B_L, wp->authType);
    875916                                        wp->authType = bstrdup(B_L, value);
    876917                                        websDecode64(userAuth, ++cp, sizeof(userAuth));
     
    10011042 */
    10021043                } else if (gstrcmp(key, T("content-length")) == 0) {
    1003                         wp->flags |= WEBS_CLEN;
    1004                         wp->clen = gatoi(value);
    1005                         websSetVar(wp, T("CONTENT_LENGTH"), value);
     1044         /*
     1045          * 11 Oct 02 BgP -- The server would crash if an attacker sent a POST
     1046          * message with a content-length value <= 0. We assume that anyone
     1047          * sending this is malicious, and the POST is read from the socket,
     1048          * but it is ignored, and the socket is closed.
     1049          */
     1050         wp->clen = gatoi(value);
     1051         if (wp->clen > 0)
     1052         {
     1053                           wp->flags |= WEBS_CLEN;                     
     1054                           websSetVar(wp, T("CONTENT_LENGTH"), value);
     1055         }
     1056         else
     1057         {
     1058            wp->clen = 0;
     1059         }
    10061060
    10071061/*
     
    10111065                        websSetVar(wp, T("CONTENT_TYPE"), value);
    10121066
    1013 #if WEBS_KEEP_ALIVE_SUPPORT
     1067#ifdef WEBS_KEEP_ALIVE_SUPPORT
    10141068                } else if (gstrcmp(key, T("connection")) == 0) {
    10151069                        strlower(value);
     
    10191073#endif
    10201074
    1021 #if WEBS_PROXY_SUPPORT
     1075#ifdef WEBS_PROXY_SUPPORT
    10221076/*
    10231077 *              This may be useful if you wish to keep a local cache of web pages
     
    10401094                        wp->cookie = bstrdup(B_L, value);
    10411095
    1042 #if WEBS_IF_MODIFIED_SUPPORT
     1096#ifdef WEBS_IF_MODIFIED_SUPPORT
    10431097/*
    10441098 *              See if the local page has been modified since the browser last
     
    11281182        }
    11291183
    1130 #if EMF
     1184#ifdef EMF
    11311185/*
    11321186 *      Add GoAhead Embedded Management Framework defines
     
    12571311        if ( !(wp->flags & WEBS_HEADER_DONE)) {
    12581312                wp->flags |= WEBS_HEADER_DONE;
    1259                 websWrite(wp, T("HTTP/1.1 %d %s\r\n"), code, websErrorMsg(code));
     1313/*
     1314 *              Redirect behaves much better when sent with HTTP/1.0
     1315 */
     1316                if (redirect != NULL) {
     1317                        websWrite(wp, T("HTTP/1.0 %d %s\r\n"), code, websErrorMsg(code));
     1318                } else {
     1319                        websWrite(wp, T("HTTP/1.1 %d %s\r\n"), code, websErrorMsg(code));
     1320                }
     1321
    12601322/*             
    12611323 *              By license terms the following line of code must not be modified.
     
    12811343                                char_t *nonce, *opaque;
    12821344
     1345            /* $$$ before... (note commas instead of semicolons...)
    12831346                                nonce = websCalcNonce(wp),
    12841347                                opaque = websCalcOpaque(wp),
     1348            $$$ after */
     1349                                nonce = websCalcNonce(wp);
     1350                                opaque = websCalcOpaque(wp);
     1351            /* ...$$$ end */
    12851352                                websWrite(wp,
    12861353                                        T("WWW-Authenticate: Digest realm=\"%s\", domain=\"%s\",")
     
    13821449 */
    13831450
     1451#ifdef qRichErrorPage
     1452extern int dmfRichError(webs_t wp, int code, char_t* userMsg);
     1453#endif
    13841454void websError(webs_t wp, int code, char_t *fmt, ...)
    13851455{
    13861456        va_list         args;
    13871457        char_t          *msg, *userMsg, *buf;
     1458#ifdef qRichErrorPage
     1459   static int reEntry = 0;
     1460   int errorOk;
     1461#endif
    13881462
    13891463        a_assert(websValid(wp));
     
    13971471        va_end(args);
    13981472
     1473#ifdef qRichErrorPage
     1474   if (!reEntry)
     1475   {
     1476      /*
     1477       * The dmfRichError function that we're about to call may very well call
     1478       * websError() as part of its work. If that happens, we do NOT want to
     1479       * get into a never-ending recursive call chain. When we get back here
     1480       * in a call from inside dmfRichError(), we check to see if we're
     1481       * already trying to call dmfRichError. If we are, we just revert to the
     1482       * old non-rich behavior and display a black on white error page.
     1483       */
     1484
     1485      reEntry = 1;
     1486      errorOk = dmfRichError(wp, code, userMsg);
     1487      reEntry = 0;
     1488      if (errorOk)
     1489      {
     1490         return;
     1491      }
     1492      /* ...else we need to fall through and execute the simple error page. */
     1493   }
     1494   /* implicit else... */
     1495#endif
     1496
    13991497        msg = T("<html><head><title>Document Error: %s</title></head>\r\n\
    14001498                <body><h2>Access Error: %s</h2>\r\n\
     
    14171515 */
    14181516
    1419 static char_t *websErrorMsg(int code)
     1517/*static char_t *websErrorMsg(int code)*/
     1518char_t *websErrorMsg(int code)
    14201519{
    14211520        websErrorType   *ep;
     
    14481547        buf = NULL;
    14491548        rc = 0;
     1549
    14501550        if (fmtValloc(&buf, WEBS_BUFSIZE, fmt, vargs) >= WEBS_BUFSIZE) {
    14511551                trace(0, T("webs: websWrite lost data, buffer overflow\n"));
    14521552        }
     1553   
    14531554        va_end(vargs);
    14541555        a_assert(buf);
     
    15981699
    15991700/******************************************************************************/
    1600 #if WEBS_LOG_SUPPORT
     1701#ifdef WEBS_LOG_SUPPORT
    16011702/*
    16021703 *      Output a log message
     
    16081709        char    *abuf;
    16091710        int             len;
    1610 
     1711#define qAnlLog 1
     1712#ifdef qAnlLog
     1713   time_t timer;
     1714   char_t* newLine = NULL;
     1715   char_t* timeStr = NULL;
     1716#endif
    16111717        a_assert(websValid(wp));
    16121718
    16131719        buf = NULL;
     1720
     1721#ifdef qAnlLog
     1722   time(&timer);
     1723   timeStr = ctime(&timer);
     1724   newLine = gstrchr(timeStr, '\n');
     1725   if (newLine)
     1726   {
     1727      *newLine = '\0';
     1728   }
     1729   fmtAlloc(&buf, WEBS_MAX_URL + 80, T("%s\t%s\t%s\tcode = %d\n"),
     1730      timeStr, wp->ipaddr, wp->url, code);
     1731#else
    16141732        fmtAlloc(&buf, WEBS_MAX_URL + 80, T("%d %s %d %d\n"), time(0),
    16151733                wp->url, code, wp->written);
     1734#endif
    16161735        len = gstrlen(buf);
    16171736        abuf = ballocUniToAsc(buf, len+1);
     
    16481767                wp->timeout = -1;
    16491768                websDone(wp, 404);
    1650 
    16511769        } else {
    16521770                delay = WEBS_TIMEOUT - tm;
     
    16741792        }
    16751793
    1676 #if WEBS_PROXY_SUPPORT
     1794#ifdef WEBS_PROXY_SUPPORT
    16771795        if (! (wp->flags & WEBS_LOCAL_PAGE)) {
    16781796                websStats.activeNetRequests--;
     
    16801798#endif
    16811799
    1682 #if WEBS_LOG_SUPPORT
     1800#ifdef WEBS_LOG_SUPPORT
    16831801        if (! (wp->flags & WEBS_REQUEST_DONE)) {
    16841802                websLog(wp, code);
     
    19612079        a_assert(websValid(wp));
    19622080
    1963 #if WEBS_PAGE_ROM
     2081#ifdef WEBS_PAGE_ROM
    19642082        return wp->path;
    19652083#else
     
    22102328 */
    22112329
    2212 void websMarkTime(webs_t wp)
     2330void websSetTimeMark(webs_t wp)
    22132331{
    22142332        wp->timestamp = time(0);
     
    22482366
    22492367
    2250 #if WEBS_IF_MODIFIED_SUPPORT
     2368#ifdef WEBS_IF_MODIFIED_SUPPORT
    22512369/******************************************************************************/
    22522370/*     
     
    25832701        long dayDifference;
    25842702
    2585         dayDifference = FixedFromGregorian(month, day, year) -
     2703     /*
     2704      * Bug fix by Jeff Reeder (Jun 14, 2002): The 'month' parameter is
     2705      * numbered from  0 (Jan == 0), but FixedFromGregorian() takes
     2706      * months numbered from 1 (January == 1). We need to add 1
     2707      * to the month
     2708      */
     2709        dayDifference = FixedFromGregorian(month + 1, day, year) -
    25862710                FixedFromGregorian(1, 1, 1970);
    25872711
     
    28352959#endif /* WEBS_IF_MODIFIED_SUPPORT */
    28362960
    2837 
    2838 /******************************************************************************/
     2961/******************************************************************************/
  • c/src/libnetworking/rtems_webserver/webs.h

    r2f73363 ree3afa2  
    55 *
    66 *      See the file "license.txt" for information on usage and redistribution
     7 *
     8 * $Id$
    79 */
    810
     
    2224#include        "ej.h"
    2325#ifdef WEBS_SSL_SUPPORT
    24 #include        "websSSL.h"
     26        #include        "websSSL.h"
    2527#endif
    2628
     
    3133 */
    3234#define WEBS_NAME                               T("GoAhead-Webs")
    33 #define WEBS_VERSION                    T("2.1")
     35#define WEBS_VERSION                    T("2.1.3")
    3436
    3537#define WEBS_HEADER_BUFINC              512                     /* Header buffer size */
     
    141143extern void      websEncode64(char_t *outbuf, char_t *string, int buflen);
    142144extern void      websError(webs_t wp, int code, char_t *msg, ...);
     145/* function websErrorMsg() made extern 03 Jun 02 BgP */
     146extern char_t   *websErrorMsg(int code);
    143147extern void      websFooter(webs_t wp);
    144148extern int               websFormDefine(char_t *name, void (*fn)(webs_t wp,
     
    207211extern int               websValid(webs_t wp);
    208212extern int               websValidateUrl(webs_t wp, char_t *path);
    209 extern void             websMarkTime(webs_t wp);
     213extern void             websSetTimeMark(webs_t wp);
    210214
    211215/*
     
    221225 *      GoAhead Embedded Management Framework (EMF)
    222226 */
    223 #if EMF
     227#ifdef EMF
    224228extern void      websFormExplain(webs_t wp, char_t *path, char_t *query);
    225229#endif
  • c/src/libnetworking/rtems_webserver/websuemf.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    4648        if (engine == EMF_SCRIPT_EJSCRIPT) {
    4749                ejid = (int) chan;
    48                 if (ejEval(ejid, cmd, NULL) ) {
     50      /*
     51       * NOTE -- to disable better reporting of ASP errors, change the
     52       * following line of code to
     53       *        if (ejEval(ejid, cmd, NULL) ) {
     54       */
     55                if (ejEval(ejid, cmd, result) ) {
    4956                        return 0;
    5057                } else {
  • c/src/libnetworking/rtems_webserver/wsIntrn.h

    r2f73363 ree3afa2  
    55 *
    66 *      See the file "license.txt" for information on usage and redistribution
     7 *
     8 * $Id$
    79 */
    810 
     
    2022
    2123/*
    22  *      Define this to enable login of web accesses to a file
     24 *      Define this to enable logging of web accesses to a file
    2325 *              #define WEBS_LOG_SUPPORT 1
    2426 *
     
    4749#include        <stdarg.h>
    4850
    49 #if WIN
    50         #include        <fcntl.h>
    51         #include        <sys/stat.h>
     51#ifdef NETWARE
     52        #include        <fcntl.h>
     53        #include        <sys/stat.h>
     54        #include        <signal.h>
    5255        #include        <io.h>
    5356#endif
    5457
    55 #if CE
    56 #if ! UEMF
     58#ifdef WIN
     59        #include        <fcntl.h>
     60        #include        <sys/stat.h>
    5761        #include        <io.h>
    5862#endif
    59 #endif
    60 
    61 #if NW
    62         #include        <fcntl.h>
    63         #include        <sys/stat.h>
    64 #endif
    65 
    66 #if SCOV5
     63
     64#ifdef CE
     65#ifndef UEMF
     66        #include        <io.h>
     67#endif
     68#endif
     69
     70#ifdef NW
     71        #include        <fcntl.h>
     72        #include        <sys/stat.h>
     73#endif
     74
     75#ifdef SCOV5
    6776        #include        <fcntl.h>
    6877        #include        <sys/stat.h>
     
    7180#endif
    7281
    73 #if LYNX
     82#ifdef LYNX
    7483        #include        <fcntl.h>
    7584        #include        <sys/stat.h>
     
    7887#endif
    7988
    80 #if UNIX
     89#ifdef UNIX
    8190        #include        <fcntl.h>
    8291        #include        <sys/stat.h>
     
    8594#endif
    8695
    87 #if QNX4
     96#ifdef QNX4
    8897        #include        <fcntl.h>
    8998        #include        <sys/stat.h>
     
    93102#endif
    94103
    95 #if UW
    96         #include        <fcntl.h>
    97         #include        <sys/stat.h>
    98 #endif
    99 
    100 #if VXWORKS
     104#ifdef UW
     105        #include        <fcntl.h>
     106        #include        <sys/stat.h>
     107#endif
     108
     109#ifdef VXWORKS
    101110        #include        <vxWorks.h>
    102111        #include        <fcntl.h>
     
    104113#endif
    105114
    106 #if SOLARIS
     115#ifdef SOLARIS
    107116        #include        <macros.h>
    108117        #include        <fcntl.h>
     
    110119#endif
    111120
    112 #if UEMF
     121#ifdef UEMF
    113122        #include        "uemf.h"
    114123        #include        "ejIntrn.h"
     
    135144#define MAX_PORT_LEN            10                      /* max digits in port number */
    136145#define WEBS_SYM_INIT           64                      /* initial # of sym table entries */
    137 #define WEBS_VERSION_STR        T("2.1.3")      /* version of web server s/w */
    138146
    139147/*
     
    202210typedef struct {
    203211        char_t                  *path;                                  /* Web page URL path */
    204         const unsigned char     *page;                                  /* Web page data */
     212        unsigned char   *page;                                  /* Web page data */
    205213        int                             size;                                   /* Size of web page in bytes */
    206214        int                             pos;                                    /* Current read position */
     
    286294 *      GoAhead Embedded Management Framework (EMF)
    287295 */
    288 #if EMF
     296#ifdef EMF
    289297extern int               websEmfOpen();
    290298extern void      websEmfClose();
     
    292300#endif
    293301
    294 #if CE
     302#ifdef CE
    295303extern int writeUniToAsc(int fid, void *buf, unsigned int len);
    296304extern int readAscToUni(int fid, void **buf, unsigned int len);
  • cpukit/httpd/NOTES

    r2f73363 ree3afa2  
    33#
    44
    5 Notes on merging GoAhead Webs 2.1.  Eventually RTEMS should be supported
     5Notes on merging GoAhead Webs 2.1.4.  Eventually RTEMS should be supported
    66in their distributions and this directory removed.
    77
     
    1010Obtain the original distribution from http://www.goahead.com for
    1111documentation.
     12
     13Porting
     14=======
     15 - added rtems complier flags to uemf.h and misc.c
     16 - following source files are distributed with the web server
     17    but not currently used by RTEMS
     18    [cgi.c, sockGen.c, umui.c, websSSL.c, websda.c]
    1219
    1320Tailoring
  • cpukit/httpd/asp.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
  • cpukit/httpd/balloc.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    2729#define IN_BALLOC
    2830
    29 #if UEMF
     31#ifdef UEMF
    3032        #include        "uemf.h"
    3133#else
     
    3638#include        <stdlib.h>
    3739
    38 #if !NO_BALLOC
     40#ifndef NO_BALLOC
    3941/********************************* Defines ************************************/
    4042
     
    4244 *      Define B_STATS if you wish to track memory block and stack usage
    4345 */
    44 #if B_STATS
     46#ifdef B_STATS
    4547/*
    4648 *      Optional statistics
     
    108110/*************************** Forward Declarations *****************************/
    109111
    110 #if B_STATS
     112#ifdef B_STATS
    111113static void bStatsAlloc(B_ARGS_DEC, void *ptr, int q, int size);
    112114static void bStatsFree(B_ARGS_DEC, void *ptr, int q, int size);
     
    115117#endif /* B_STATS */
    116118
    117 #if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD
     119#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
    118120static void bFillBlock(void *buf, int bufsize);
    119121#endif
    120122
    121 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     123#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    122124static void verifyUsedBlock(bType *bp, int q);
    123125static void verifyFreeBlock(bType *bp, int q);
     
    142144        bFlags = flags;
    143145
    144 #if BASTARD_TESTING
     146#ifdef BASTARD_TESTING
    145147        srand(time(0L));
    146148#endif /* BASTARD_TESTING */
     
    164166                        return -1;
    165167                }
    166 #if B_STATS
     168#ifdef B_STATS
    167169                bStatsMemMalloc += bufsize;
    168170#endif
     
    174176        bFreeBuf = bFreeNext = buf;
    175177        memset(bQhead, 0, sizeof(bQhead));
    176 #if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD
     178#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
    177179        bFillBlock(buf, bufsize);
    178180#endif
    179 #if B_STATS
     181#ifdef B_STATS
    180182        bStackStart = &buf;
    181183#endif
    182 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     184#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    183185        verifyFreeBlock(buf, bufsize);
    184186#endif
     
    193195void bclose()
    194196{
    195 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     197#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    196198        verifyBallocSpace();
    197199#endif
     
    221223                }
    222224        }
    223 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     225#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    224226        verifyBallocSpace();
    225227#endif
     
    228230        }
    229231
    230 #if BASTARD_TESTING
     232#ifdef BASTARD_TESTING
    231233        if (rand() == 0x7fff) {
    232234                return NULL;
     
    242244 */
    243245                if (bFlags & B_USE_MALLOC) {
    244 #if B_STATS
     246#ifdef B_STATS
    245247                        bstats(0, NULL);
    246248#endif
     
    253255                                return NULL;
    254256                        }
    255 #if B_STATS
     257#ifdef B_STATS
    256258                        bStatsMemMalloc += memSize;
    257259#endif
    258 #if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD
     260#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
    259261                        bFillBlock(bp, memSize);
    260262#endif
     
    276278 */
    277279                bQhead[q] = bp->u.next;
    278 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     280#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    279281                verifyFreeBlock(bp, q);
    280282#endif
    281 #if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD
     283#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
    282284                bFillBlock(bp, memSize);
    283285#endif
     
    292294 */
    293295                        bp = (bType*) bFreeNext;
    294 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     296#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    295297                        verifyFreeBlock(bp, q);
    296298#endif
    297299                        bFreeNext += memSize;
    298300                        bFreeLeft -= memSize;
    299 #if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD
     301#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
    300302                        bFillBlock(bp, memSize);
    301303#endif
     
    304306
    305307                } else if (bFlags & B_USE_MALLOC) {
    306 #if B_STATS
     308#ifdef B_STATS
    307309                        static int once = 0;
    308310                        if (once++ == 0) {
     
    320322                                return NULL;
    321323                        }
    322 #if B_STATS
     324#ifdef B_STATS
    323325                        bStatsMemMalloc += memSize;
    324326#endif
    325 #if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD
     327#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
    326328                        bFillBlock(bp, memSize);
    327329#endif
     
    335337        }
    336338
    337 #if B_STATS
     339#ifdef B_STATS
    338340        bStatsAlloc(B_ARGS, bp, q, memSize);
    339341#endif
     
    345347 */
    346348#if 0
    347 #if B_STATS
     349#ifdef B_STATS
    348350        if (bStatsBallocInUse == bStatsBallocMax) {
    349351                bstats(0, NULL);
     
    366368        int             q, memSize;
    367369
    368 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     370#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    369371        verifyBallocSpace();
    370372#endif
     
    379381        memSize = ballocGetSize(bp->u.size, &q);
    380382
    381 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     383#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    382384        verifyUsedBlock(bp,q);
    383385#endif
    384 #if B_STATS
     386#ifdef B_STATS
    385387        bStatsFree(B_ARGS, bp, q, bp->u.size+sizeof(bType));
    386388#endif
     
    390392        }
    391393               
    392 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     394#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    393395        bFillBlock(bp, memSize);
    394396#endif
     
    416418
    417419/******************************************************************************/
    418 #if UNICODE
     420#ifdef UNICODE
    419421/*
    420422 *      Duplicate a string, allow NULL pointers and then dup an empty string.
     
    511513
    512514/******************************************************************************/
    513 #if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD
     515#if (defined (B_FILL) || defined (B_VERIFY_CAUSES_SEVERE_OVERHEAD))
    514516/*
    515517 *      Fill the block (useful during development to catch zero fill assumptions)
     
    523525
    524526/******************************************************************************/
    525 #if B_STATS
     527#ifdef B_STATS
    526528/*
    527529 *      Statistics. Do output via calling the writefn callback function with
     
    817819
    818820/******************************************************************************/
    819 #if B_VERIFY_CAUSES_SEVERE_OVERHEAD
     821#ifdef B_VERIFY_CAUSES_SEVERE_OVERHEAD
    820822/*
    821823 *      The following routines verify the integrity of the balloc memory space.
     
    937939char_t *bstrdupNoBalloc(char_t *s)
    938940{
    939 #if UNICODE
     941#ifdef UNICODE
    940942        if (s) {
    941943                return wcsdup(s);
  • cpukit/httpd/default.c

    r2f73363 ree3afa2  
    8585 *      Open the document. Stat for later use.
    8686 */
    87         if (websPageOpen(wp, lpath, path, SOCKET_RDONLY | SOCKET_BINARY,
    88                                 0666) < 0) {
    89                         websError(wp, 400,
    90                                 T("Cannot open URL <b>%s</b>"), url);
    91                         return 1;
    92                 }
    93                 if (websPageStat(wp, lpath, path, &sbuf) < 0) {
    94                         websError(wp, 400, T("Cannot stat page for URL <b>%s</b>"),
    95                                 url);
    96                         return 1;
    97                 }
     87        if (websPageOpen(wp, lpath, path, SOCKET_RDONLY | SOCKET_BINARY,
     88                0666) < 0) {
     89                websError(wp, 400, T("Cannot open URL <b>%s</b>"), url);
     90                return 1;
     91        }
     92
     93        if (websPageStat(wp, lpath, path, &sbuf) < 0) {
     94                websError(wp, 400, T("Cannot stat page for URL <b>%s</b>"), url);
     95                return 1;
     96        }
    9897
    9998/*
     
    103102 */
    104103        websStats.localHits++;
    105 #if WEBS_IF_MODIFIED_SUPPORT
     104#ifdef WEBS_IF_MODIFIED_SUPPORT
    106105        if (flags & WEBS_IF_MODIFIED && !(flags & WEBS_ASP)) {
    107106                if (sbuf.mtime <= wp->since) {
     
    228227        len = npart = 0;
    229228        parts[0] = NULL;
     229
     230   /*
     231    * 22 Jul 02 -- there were reports that a directory traversal exploit was
     232    * possible in the WebServer running under Windows if directory paths
     233    * outside the server's specified root web were given by URL-encoding the
     234    * backslash character, like:
     235    *
     236    *  GoAhead is vulnerable to a directory traversal bug. A request such as
     237    * 
     238    *  GoAhead-server/../../../../../../../ results in an error message
     239    *  'Cannot open URL'.
     240
     241    *  However, by encoding the '/' character, it is possible to break out of
     242    *  the
     243    *  web root and read arbitrary files from the server.
     244    *  Hence a request like:
     245    *
     246    *  GoAhead-server/..%5C..%5C..%5C..%5C..%5C..%5C/winnt/win.ini returns the
     247    *  contents of the win.ini file.
     248    * (Note that the description uses forward slashes (0x2F), but the example
     249    * uses backslashes (0x5C). In my tests, forward slashes are correctly
     250    * trapped, but backslashes are not. The code below substitutes forward
     251    * slashes for backslashes before attempting to validate that there are no
     252    * unauthorized paths being accessed.
     253    */
     254   token = gstrchr(path, '\\');
     255   while (token != NULL)
     256   {
     257      *token = '/';
     258      token = gstrchr(token, '\\');
     259   }
     260   
    230261        token = gstrtok(path, T("/"));
    231262
     
    285316        flags = websGetRequestFlags(wp);
    286317
    287         websMarkTime(wp);
     318        websSetTimeMark(wp);
    288319
    289320        wrote = bytes = 0;
     
    301332                if ((buf = balloc(B_L, PAGE_READ_BUFSIZE)) == NULL) {
    302333                        websError(wp, 200, T("Can't get memory"));
    303                 }
    304                 else {
     334                } else {
    305335                        while ((len = websPageReadData(wp, buf, PAGE_READ_BUFSIZE)) > 0) {
    306336                                if ((wrote = websWriteDataNonBlock(wp, buf, len)) < 0) {
  • cpukit/httpd/ej.h

    r2f73363 ree3afa2  
    55 *
    66 *      See the file "license.txt" for information on usage and redistribution
     7 *
     8 * $Id$
    79 */
    810
     
    1921/********************************* Includes ***********************************/
    2022
    21 #if ! UEMF
     23#ifndef UEMF
    2224        #include        "basic/basic.h"
    2325        #include        "emf/emf.h"
  • cpukit/httpd/ejIntrn.h

    r2f73363 ree3afa2  
    55 *
    66 *      See the file "license.txt" for information on usage and redistribution
     7 *
     8 * $Id$
    79 */
    810
     
    2325#include        <stdlib.h>
    2426
    25 #if CE
    26 #if ! UEMF
     27#ifdef CE
     28#ifndef UEMF
    2729        #include        <io.h>
    2830#endif
    2931#endif
    3032
    31 #if LYNX
     33#ifdef LYNX
    3234        #include        <unistd.h>
    3335#endif
     
    3739#endif
    3840
    39 #if UEMF
     41#ifdef UEMF
    4042        #include        "uemf.h"
    4143#else
  • cpukit/httpd/ejlex.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    1820#include        "ejIntrn.h"
    1921
    20 #if UEMF
     22#ifdef UEMF
    2123        #include "uemf.h"
    2224#else
     
    195197{
    196198        ep->tid = getLexicalToken(ep, state);
     199   /*
     200    * commented out 04 Apr 02 Bg Porter -- we found a case where very long
     201    * arguments to write() were being corrupted downstream in the trace call
     202    * (the ep->token pointer was being overwritten with the trace message.
     203    * restore this if it's useful for your debugging.
    197204        trace(9, T("ejGetToken: %d, \"%s\"\n"), ep->tid, ep->token);
     205    */
    198206        return ep->tid;
    199207}
  • cpukit/httpd/ejparse.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    1820#include        "ejIntrn.h"
    1921
    20 #if CE
     22#ifdef CE
    2123        #include        "CE/wincompat.h"
    2224#endif
     
    99101        ejSetGlobalVar(ep->eid, T("null"), NULL);
    100102
    101 #if EMF
     103#ifdef EMF
    102104        ejEmfOpen(ep->eid);
    103105#endif
     
    119121        }
    120122
    121 #if EMF
     123#ifdef EMF
    122124        ejEmfClose(eid);
    123125#endif
  • cpukit/httpd/emfdb.c

    r2f73363 ree3afa2  
    663663        if (pLineOut) {
    664664                len = gstrlen(pLineOut);
    665 #if CE
     665#ifdef CE
    666666                rc = writeUniToAsc(fd, pLineOut, len);
    667667#else
     
    854854 */
    855855        buf = balloc(B_L, sbuf.st_size + 1);
    856 #if CE
     856#ifdef CE
    857857        if (readAscToUni(fd, &buf, sbuf.st_size) != (int)sbuf.st_size) {
    858858#else
     
    10201020        int len;
    10211021
    1022         if (basicProdDir != NULL) {
    1023                 bfree(B_L, basicProdDir);
     1022        if (basicProdDir != NULL) {     
     1023      bfree(B_L, basicProdDir);
    10241024        }
    10251025   
  • cpukit/httpd/emfdb.h

    r2f73363 ree3afa2  
    1919#define _h_EMFDB 1
    2020
    21 #if ! UEMF
     21#ifndef UEMF
    2222        #include        "basic/basic.h"
    2323        #include        "emf/emf.h"
  • cpukit/httpd/form.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
  • cpukit/httpd/h.c

    r2f73363 ree3afa2  
    44 * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
    55 * See the file "license.txt" for usage and redistribution license requirements
     6 *
     7 * $Id$
    68 */
    79
     
    1618/********************************* Includes ***********************************/
    1719
    18 #if UEMF
     20#ifdef UEMF
    1921        #include        "uemf.h"
    2022#else
     
    4244 */
    4345
    44 #if B_STATS
     46#ifdef B_STATS
    4547int HALLOC(B_ARGS_DEC, void ***map)
    4648#else
     
    5658                incr = H_INCR;
    5759                memsize = (incr + H_OFFSET) * sizeof(void**);
    58 #if B_STATS
     60#ifdef B_STATS
    5961                if ((mp = (int*) balloc(B_ARGS, memsize)) == NULL) {
    6062#else
     
    149151 */
    150152
    151 #if B_STATS
     153#ifdef B_STATS
    152154int HALLOCENTRY(B_ARGS_DEC, void ***list, int *max, int size)
    153155#else
     
    161163        a_assert(max);
    162164
    163 #if B_STATS
     165#ifdef B_STATS
    164166        if ((id = HALLOC(B_ARGS, (void***) list)) < 0) {
    165167#else
     
    170172
    171173        if (size > 0) {
    172 #if B_STATS
     174#ifdef B_STATS
    173175                if ((cp = balloc(B_ARGS, size)) == NULL) {
    174176#else
  • cpukit/httpd/handler.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    2628/**************************** Forward Declarations ****************************/
    2729
    28 static int      websUrlHandlerSort(const void *p1, const void *p2);
    29 static int      websPublishHandler(webs_t wp, char_t *urlPrefix, char_t *webDir,
     30static int              websUrlHandlerSort(const void *p1, const void *p2);
     31static int              websPublishHandler(webs_t wp, char_t *urlPrefix, char_t *webDir,
    3032                                int sid, char_t *url, char_t *path, char_t *query);
    31 static int      websTidyUrl(webs_t wp);
     33static char_t   *websCondenseMultipleChars(char_t *strToCondense, char_t cCondense);
    3234
    3335/*********************************** Code *************************************/
     
    257259        websSetRequestPath(wp, websGetDefaultDir(), NULL);
    258260
    259         websTidyUrl(wp);
     261/*
     262 *      Eliminate security hole
     263 */
     264        websCondenseMultipleChars(wp->path, '/');
     265        websCondenseMultipleChars(wp->url, '/');
    260266
    261267/*
     
    293299}
    294300
     301#ifdef OBSOLETE_CODE
    295302
    296303/******************************************************************************/
     
    359366}
    360367
    361 /******************************************************************************/
     368#endif
     369
     370/******************************************************************************/
     371/*
     372 *      Convert multiple adjacent occurrences of a given character to a single
     373 *      instance.
     374 */
     375
     376static char_t *websCondenseMultipleChars(char_t *strToCondense, char_t cCondense)
     377{
     378        if (strToCondense != NULL) {
     379                char_t *pStr, *pScan;
     380
     381                pStr = pScan = strToCondense;
     382
     383                while (*pScan && *pStr) {
     384/*
     385 *                      Advance scan pointer over multiple occurences of condense character
     386 */
     387                        while ((*pScan == cCondense) && (*(pScan + 1) == cCondense)) {
     388                                pScan++;
     389                        }
     390/*
     391 *                      Copy character if an advance of the scan pointer has occurred
     392 */
     393                        if (pStr != pScan) {
     394                                *pStr = *pScan;
     395                        }
     396                       
     397                        pScan++;
     398                        pStr++;
     399                }
     400/*
     401 *              Zero terminate string if multiple adjacent characters were found and condensed
     402 */
     403                if (pStr != pScan) {
     404                        *pStr = 0;
     405                }
     406        }
     407
     408        return strToCondense;
     409}
     410
     411/******************************************************************************/
  • cpukit/httpd/license.txt

    r2f73363 ree3afa2  
    11License Agreement
    22
    3 THIS LICENSE ALLOWS ONLY THE LIMITED USE OF GO AHEAD SOFTWARE, INC. PROPRIETARY CODE.  PLEASE CAREFULLY READ THIS AGREEMENT AS IT PERTAINS TO THIS LICENSE, YOU CERTIFY THAT YOU WILL USE THE SOFTWARE ONLY IN THE MANNER PERMITTED HEREIN.
     3THIS LICENSE ALLOWS ONLY THE LIMITED USE OF GO AHEAD SOFTWARE,
     4INC. PROPRIETARY CODE.  PLEASE CAREFULLY READ THIS AGREEMENT AS IT
     5PERTAINS TO THIS LICENSE, YOU CERTIFY THAT YOU WILL USE THE SOFTWARE
     6ONLY IN THE MANNER PERMITTED HEREIN.
    47
    581. Definitions.
    69
    7 1.1 "Documentation" means any documentation GoAhead includes with the Original Code.
     101.1 "Documentation" means any documentation GoAhead includes with the
     11Original Code.
    812
    9131.2 "GoAhead" means Go Ahead Software, Inc.
    1014
    11 1.3 "Intellectual Property Rights" means all rights, whether now existing or hereinafter acquired, in and to trade secrets, patents, copyrights, trademarks, know-how, as well as moral rights and similar rights of any type under the laws of any governmental authority, domestic or foreign, including rights in and to all applications and registrations relating to any of the foregoing.
     151.3 "Intellectual Property Rights" means all rights, whether now existing
     16or hereinafter acquired, in and to trade secrets, patents, copyrights,
     17trademarks, know-how, as well as moral rights and similar rights of any
     18type under the laws of any governmental authority, domestic or foreign,
     19including rights in and to all applications and registrations relating
     20to any of the foregoing.
    1221
    13221.4 "License" or "Agreement" means this document.
    1423
    15 1.5 "Modifications" means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications.
    16 
    17 1.6 "Original Code" means the Source Code to GoAhead’s proprietary computer software entitled GoAhead WebServer.
    18 
    19 1.7 "Response Header" means the first portion of the response message output by the GoAhead WebServer, containing but not limited to, header fields for date, content-type, server identification and cache control.
    20 
    21 1.8 "Server Identification Field" means the field in the Response Header which contains the text "Server: GoAhead-Webs".
    22 
    23 1.9 "You" means an individual or a legal entity exercising rights under, and complying with all of the terms of, this license or a future version of this license. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.
     241.5 "Modifications" means any addition to or deletion from the substance
     25or structure of either the Original Code or any previous Modifications.
     26
     271.6 "Original Code" means the Source Code to GoAhead’s proprietary
     28computer software entitled GoAhead WebServer.
     29
     301.7 "Response Header" means the first portion of the response message
     31output by the GoAhead WebServer, containing but not limited to, header
     32fields for date, content-type, server identification and cache control.
     33
     341.8 "Server Identification Field" means the field in the Response Header
     35which contains the text "Server: GoAhead-Webs".
     36
     371.9 "You" means an individual or a legal entity exercising rights under,
     38and complying with all of the terms of, this license or a future version
     39of this license. For legal entities, "You" includes any entity which
     40controls, is controlled by, or is under common control with You. For
     41purposes of this definition, "control" means (a) the power, direct or
     42indirect, to cause the direction or management of such entity, whether
     43by contract or otherwise, or (b) ownership of fifty percent (50%) or
     44more of the outstanding shares or beneficial ownership of such entity.
    2445
    25462. Source Code License.
     
    27482.1 Limited Source Code Grant.
    2849
    29 GoAhead hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims, to use, reproduce, modify, copy and distribute the Original Code.
     50GoAhead hereby grants You a world-wide, royalty-free, non-exclusive
     51license, subject to third party intellectual property claims, to use,
     52reproduce, modify, copy and distribute the Original Code.
    3053
    31542.2 Binary Code.
    3255
    33 GoAhead hereby grants You a world-wide, royalty-free, non-exclusive license to copy and distribute the binary code versions of the Original Code together with Your Modifications.
     56GoAhead hereby grants You a world-wide, royalty-free, non-exclusive
     57license to copy and distribute the binary code versions of the Original
     58Code together with Your Modifications.
    3459
    35602.3 License Back to GoAhead.
    3661
    37 You hereby grant in both source code and binary code to GoAhead a world-wide, royalty-free, non-exclusive license to copy, modify, display, use and sublicense any Modifications You make that are distributed or planned for distribution.  Within 30 days of either such event, You agree to ship to GoAhead a file containing the Modifications (in a media to be determined by the parties), including any programmers’ notes and other programmers’ materials. Additionally, You will provide to GoAhead a complete description of the product, the product code or model number, the date on which the product is initially shipped, and a contact name, phone number and e-mail address for future correspondence. GoAhead will keep confidential all data specifically marked as such.
     62You hereby grant in both source code and binary code to GoAhead a
     63world-wide, royalty-free, non-exclusive license to copy, modify, display,
     64use and sublicense any Modifications You make that are distributed or
     65planned for distribution.  Within 30 days of either such event, You
     66agree to ship to GoAhead a file containing the Modifications (in a media
     67to be determined by the parties), including any programmers’ notes and
     68other programmers’ materials. Additionally, You will provide to GoAhead
     69a complete description of the product, the product code or model number,
     70the date on which the product is initially shipped, and a contact name,
     71phone number and e-mail address for future correspondence. GoAhead will
     72keep confidential all data specifically marked as such.
    3873
    39742.4 Restrictions on Use.
    4075
    41 You may sublicense Modifications to third parties such as subcontractors or OEM's provided that You enter into license agreements with such third parties that bind such third parties to all the obligations under this Agreement applicable to you and that are otherwise substantially similar in scope and application to this Agreement.
     76You may sublicense Modifications to third parties such as subcontractors
     77or OEM's provided that You enter into license agreements with such third
     78parties that bind such third parties to all the obligations under this
     79Agreement applicable to you and that are otherwise substantially similar
     80in scope and application to this Agreement.
    4281
    43823. Term.
    4483
    45 This Agreement and license are effective from the time You accept the terms of this Agreement until this Agreement is terminated. You may terminate this Agreement at any time by uninstalling or destroying all copies of the Original Code including any and all binary versions and removing any Modifications to the Original Code existing in any products. This Agreement will terminate immediately and without further notice if You fail to comply with any provision of this Agreement. All restrictions on use, and all other provisions that may reasonably be interpreted to survive termination of this Agreement, will survive termination of this Agreement for any reason. Upon termination, You agree to uninstall or destroy all copies of the Original Code, Modifications, and Documentation.
     84This Agreement and license are effective from the time You accept the
     85terms of this Agreement until this Agreement is terminated. You may
     86terminate this Agreement at any time by uninstalling or destroying
     87all copies of the Original Code including any and all binary versions
     88and removing any Modifications to the Original Code existing in any
     89products. This Agreement will terminate immediately and without further
     90notice if You fail to comply with any provision of this Agreement. All
     91restrictions on use, and all other provisions that may reasonably
     92be interpreted to survive termination of this Agreement, will survive
     93termination of this Agreement for any reason. Upon termination, You agree
     94to uninstall or destroy all copies of the Original Code, Modifications,
     95and Documentation.
    4696
    47974. Trademarks and Brand.
     
    49994.1 License and Use.
    50100
    51 GoAhead hereby grants to You a limited world-wide, royalty-free, non-exclusive license to use the GoAhead trade names, trademarks, logos, service marks and product designations posted in Exhibit A (collectively, the "GoAhead Marks") in connection with the activities by You under this Agreement. Additionally, GoAhead grants You a license under the terms above to such GoAhead trademarks as shall be identified at a URL (the "URL") provided by GoAhead. The use by You of GoAhead Marks shall be in accordance with GoAhead’s trademark policies regarding trademark usage as established at the web site designated by the URL, or as otherwise communicated to You by GoAhead at its sole discretion. You understand and agree that any use of GoAhead Marks in connection with this Agreement shall not create any right, title or interest in or to such GoAhead Marks and that all such use and goodwill associated with GoAhead Marks will inure to the benefit of GoAhead.
     101GoAhead hereby grants to You a limited world-wide, royalty-free,
     102non-exclusive license to use the GoAhead trade names, trademarks, logos,
     103service marks and product designations posted in Exhibit A (collectively,
     104the "GoAhead Marks") in connection with the activities by You under this
     105Agreement. Additionally, GoAhead grants You a license under the terms
     106above to such GoAhead trademarks as shall be identified at a URL (the
     107"URL") provided by GoAhead. The use by You of GoAhead Marks shall be in
     108accordance with GoAhead’s trademark policies regarding trademark usage
     109as established at the web site designated by the URL, or as otherwise
     110communicated to You by GoAhead at its sole discretion. You understand and
     111agree that any use of GoAhead Marks in connection with this Agreement
     112shall not create any right, title or interest in or to such GoAhead
     113Marks and that all such use and goodwill associated with GoAhead Marks
     114will inure to the benefit of GoAhead.
    52115
    531164.2 Promotion by You of GoAhead WebServer Mark.
    54117
    55 In consideration for the licenses granted by GoAhead to You herein, You agree to notify GoAhead when You incorporate the GoAhead WebServer in Your product and to inform GoAhead when such product begins to ship. You agree to promote the Original Code by prominently and visibly displaying a graphic of the GoAhead WebServer mark on the initial web page of Your product that is displayed each time a user connects to it. You also agree that GoAhead may identify your company as a user of the GoAhead WebServer in conjunction with its own marketing efforts. You may further promote the Original Code by displaying the GoAhead WebServer mark in marketing and promotional materials such as the home page of your web site or web pages promoting the product.
     118In consideration for the licenses granted by GoAhead to You herein, You
     119agree to notify GoAhead when You incorporate the GoAhead WebServer in
     120Your product and to inform GoAhead when such product begins to ship. You
     121agree to promote the Original Code by prominently and visibly displaying
     122a graphic of the GoAhead WebServer mark on the initial web page of Your
     123product that is displayed each time a user connects to it. You also agree
     124that GoAhead may identify your company as a user of the GoAhead WebServer
     125in conjunction with its own marketing efforts. You may further promote
     126the Original Code by displaying the GoAhead WebServer mark in marketing
     127and promotional materials such as the home page of your web site or web
     128pages promoting the product.
    56129
    571304.3 Placement of Copyright Notice by You.
    58131
    59 You agree to include copies of the following notice (the "Notice") regarding proprietary rights in all copies of the products that You distribute, as follows: (i) embedded in the object code; and (ii) on the title pages of all documentation. Furthermore, You agree to use commercially reasonable efforts to cause any licensees of your products to embed the Notice in object code and on the title pages or relevant documentation. The Notice is as follows: Copyright (c) 20xx GoAhead Software, Inc. All Rights Reserved. Unless GoAhead otherwise instructs, the year 20xx is to be replaced with the year during which the release of the Original Code containing the notice is issued by GoAhead. If this year is not supplied with Documentation, GoAhead will supply it upon request.
     132You agree to include copies of the following notice (the "Notice")
     133regarding proprietary rights in all copies of the products that You
     134distribute, as follows: (i) embedded in the object code; and (ii) on
     135the title pages of all documentation. Furthermore, You agree to use
     136commercially reasonable efforts to cause any licensees of your products
     137to embed the Notice in object code and on the title pages or relevant
     138documentation. The Notice is as follows: Copyright (c) 20xx GoAhead
     139Software, Inc. All Rights Reserved. Unless GoAhead otherwise instructs,
     140the year 20xx is to be replaced with the year during which the release of
     141the Original Code containing the notice is issued by GoAhead. If this year
     142is not supplied with Documentation, GoAhead will supply it upon request.
    60143
    611444.4 No Modifications to Server Identification Field. 
    62145
    63 You agree not to remove or modify the Server identification Field contained in the Response Header as defined in Section 1.6 and 1.7.
     146You agree not to remove or modify the Server identification Field
     147contained in the Response Header as defined in Section 1.6 and 1.7.
    64148
    651495. Warranty Disclaimers.
    66150
    67 THE ORIGINAL CODE, THE DOCUMENTATION AND THE MEDIA UPON WHICH THE ORIGINAL CODE IS RECORDED (IF ANY) ARE PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS, STATUTORY OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
    68 
    69 The entire risk as to the quality and performance of the Original Code (including any Modifications You make) and the Documentation is with You. Should the Original Code or the Documentation prove defective, You (and not GoAhead or its distributors, licensors or dealers) assume the entire cost of all necessary servicing or repair. GoAhead does not warrant that the functions contained in the Original Code will meet your requirements or operate in the combination that You may select for use, that the operation of the Original Code will be uninterrupted or error free, or that defects in the Original Code will be corrected. No oral or written statement by GoAhead or by a representative of GoAhead shall create a warranty or increase the scope of this warranty.
    70 
    71 GOAHEAD DOES NOT WARRANT THE ORIGINAL CODE AGAINST INFRINGEMENT OR THE LIKE WITH RESPECT TO ANY COPYRIGHT, PATENT, TRADE SECRET, TRADEMARK OR OTHER PROPRIETARY RIGHT OF ANY THIRD PARTY AND DOES NOT WARRANT THAT THE ORIGINAL CODE DOES NOT INCLUDE ANY VIRUS, SOFTWARE ROUTINE OR OTHER SOFTWARE DESIGNED TO PERMIT UNAUTHORIZED ACCESS, TO DISABLE, ERASE OR OTHERWISE HARM SOFTWARE, HARDWARE OR DATA, OR TO PERFORM ANY OTHER SUCH ACTIONS.
    72 
    73 Any warranties that by law survive the foregoing disclaimers shall terminate ninety (90) days from the date You received the Original Code.
     151THE ORIGINAL CODE, THE DOCUMENTATION AND THE MEDIA UPON WHICH THE ORIGINAL
     152CODE IS RECORDED (IF ANY) ARE PROVIDED "AS IS" AND WITHOUT WARRANTIES OF
     153ANY KIND, EXPRESS, STATUTORY OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
     154THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     155PURPOSE.
     156
     157The entire risk as to the quality and performance of the Original Code
     158(including any Modifications You make) and the Documentation is with
     159You. Should the Original Code or the Documentation prove defective,
     160You (and not GoAhead or its distributors, licensors or dealers) assume
     161the entire cost of all necessary servicing or repair. GoAhead does not
     162warrant that the functions contained in the Original Code will meet your
     163requirements or operate in the combination that You may select for use,
     164that the operation of the Original Code will be uninterrupted or error
     165free, or that defects in the Original Code will be corrected. No oral
     166or written statement by GoAhead or by a representative of GoAhead shall
     167create a warranty or increase the scope of this warranty.
     168
     169GOAHEAD DOES NOT WARRANT THE ORIGINAL CODE AGAINST INFRINGEMENT OR THE
     170LIKE WITH RESPECT TO ANY COPYRIGHT, PATENT, TRADE SECRET, TRADEMARK
     171OR OTHER PROPRIETARY RIGHT OF ANY THIRD PARTY AND DOES NOT WARRANT
     172THAT THE ORIGINAL CODE DOES NOT INCLUDE ANY VIRUS, SOFTWARE ROUTINE
     173OR OTHER SOFTWARE DESIGNED TO PERMIT UNAUTHORIZED ACCESS, TO DISABLE,
     174ERASE OR OTHERWISE HARM SOFTWARE, HARDWARE OR DATA, OR TO PERFORM ANY
     175OTHER SUCH ACTIONS.
     176
     177Any warranties that by law survive the foregoing disclaimers shall
     178terminate ninety (90) days from the date You received the Original Code.
    74179
    751806. Limitation of Liability.
    76181
    77 YOUR SOLE REMEDIES AND GOAHEAD'S ENTIRE LIABILITY ARE SET FORTH ABOVE. IN NO EVENT WILL GOAHEAD OR ITS DISTRIBUTORS OR DEALERS BE LIABLE FOR DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES RESULTING FROM THE USE OF THE ORIGINAL CODE, THE INABILITY TO USE THE ORIGINAL CODE, OR ANY DEFECT IN THE ORIGINAL CODE, INCLUDING ANY LOST PROFITS, EVEN IF THEY HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    78 
    79 You agree that GoAhead and its distributors and dealers will not be LIABLE for defense or indemnity with respect to any claim against You by any third party arising from your possession or use of the Original Code or the Documentation.
    80 
    81 In no event will GoAhead’s total liability to You for all damages, losses, and causes of action (whether in contract, tort, including negligence, or otherwise) exceed the amount You paid for this product.
    82 
    83 SOME STATES DO NOT ALLOW LIMITATIONS ON HOW LONG AN IMPLIED WARRANTY LASTS, AND SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE LIMITATIONS OR EXCLUSIONS MAY NOT APPLY TO YOU. THIS WARRANTY GIVES YOU SPECIFIC LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS WHICH VARY FROM STATE TO STATE.
     182YOUR SOLE REMEDIES AND GOAHEAD'S ENTIRE LIABILITY ARE SET FORTH ABOVE. IN
     183NO EVENT WILL GOAHEAD OR ITS DISTRIBUTORS OR DEALERS BE LIABLE FOR
     184DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES RESULTING FROM
     185THE USE OF THE ORIGINAL CODE, THE INABILITY TO USE THE ORIGINAL CODE,
     186OR ANY DEFECT IN THE ORIGINAL CODE, INCLUDING ANY LOST PROFITS, EVEN IF
     187THEY HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     188
     189You agree that GoAhead and its distributors and dealers will not be
     190LIABLE for defense or indemnity with respect to any claim against You
     191by any third party arising from your possession or use of the Original
     192Code or the Documentation.
     193
     194In no event will GoAhead’s total liability to You for all damages, losses,
     195and causes of action (whether in contract, tort, including negligence,
     196or otherwise) exceed the amount You paid for this product.
     197
     198SOME STATES DO NOT ALLOW LIMITATIONS ON HOW LONG AN IMPLIED WARRANTY
     199LASTS, AND SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION
     200OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE LIMITATIONS OR
     201EXCLUSIONS MAY NOT APPLY TO YOU. THIS WARRANTY GIVES YOU SPECIFIC LEGAL
     202RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS WHICH VARY FROM STATE TO STATE.
    84203
    852047. Indemnification by You.
    86205
    87 You agree to indemnify and hold GoAhead harmless against any and all claims, losses, damages and costs (including legal expenses and reasonable counsel fees) arising out of any claim of a third party with respect to the contents of the Your products, and any intellectual property rights or other rights or interests related thereto.
     206You agree to indemnify and hold GoAhead harmless against any and all
     207claims, losses, damages and costs (including legal expenses and reasonable
     208counsel fees) arising out of any claim of a third party with respect to
     209the contents of the Your products, and any intellectual property rights
     210or other rights or interests related thereto.
    88211
    892128. High Risk Activities. 
    90213
    91 The Original Code is not fault-tolerant and is not designed , manufactured or intended for use or resale as online control equipment in hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines or weapons systems, in which the failure of the Original Code could lead directly to death, personal injury, or severe physical or environmental damage.  GoAhead and its suppliers specifically disclaim any express or implied warranty of fitness for any high risk uses listed above.
     214The Original Code is not fault-tolerant and is not designed , manufactured
     215or intended for use or resale as online control equipment in hazardous
     216environments requiring fail-safe performance, such as in the operation
     217of nuclear facilities, aircraft navigation or communication systems,
     218air traffic control, direct life support machines or weapons systems,
     219in which the failure of the Original Code could lead directly to death,
     220personal injury, or severe physical or environmental damage.  GoAhead and
     221its suppliers specifically disclaim any express or implied warranty of
     222fitness for any high risk uses listed above.
    92223
    932249. Government Restricted Rights.
    94225
    95 For units of the Department of Defense, use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013. Contractor/manufacturer is GoAhead Software, Inc., 10900 N.E. 8th Street, Suite 750, Bellevue, Washington 98004.
    96 
    97 If the Commercial Computer Software Restricted rights clause at FAR 52.227-19 or its successors apply, the Software and Documentation constitute restricted computer software as defined in that clause and the Government shall not have the license for published software set forth in subparagraph (c)(3) of that clause.
    98 
    99 The Original Code (i) was developed at private expense, and no part of it was developed with governmental funds; (ii) is a trade secret of GoAhead (or its licensor(s)) for all purposes of the Freedom of Information Act; (iii) is "restricted computer software" subject to limited utilization as provided in the contract between the vendor and the governmental entity; and (iv) in all respects is proprietary data belonging solely to GoAhead (or its licensor(s)).
     226For units of the Department of Defense, use, duplication, or disclosure
     227by the Government is subject to restrictions as set forth in subparagraph
     228(c)(1)(ii) of the Rights in Technical Data and Computer Software clause
     229at DFARS 252.227-7013. Contractor/manufacturer is GoAhead Software,
     230Inc., 10900 N.E. 8th Street, Suite 750, Bellevue, Washington 98004.
     231
     232If the Commercial Computer Software Restricted rights clause at FAR
     23352.227-19 or its successors apply, the Software and Documentation
     234constitute restricted computer software as defined in that clause and
     235the Government shall not have the license for published software set
     236forth in subparagraph (c)(3) of that clause.
     237
     238The Original Code (i) was developed at private expense, and no part of it
     239was developed with governmental funds; (ii) is a trade secret of GoAhead
     240(or its licensor(s)) for all purposes of the Freedom of Information Act;
     241(iii) is "restricted computer software" subject to limited utilization as
     242provided in the contract between the vendor and the governmental entity;
     243and (iv) in all respects is proprietary data belonging solely to GoAhead
     244(or its licensor(s)).
    100245
    10124610. Governing Law and Interpretation.
    102247
    103 This Agreement shall be interpreted under and governed by the laws of the State of Washington, without regard to its rules governing the conflict of laws. If any provision of this Agreement is held illegal or unenforceable by a court or tribunal of competent jurisdiction, the remaining provisions of this Agreement shall remain in effect and the invalid provision deemed modified to the least degree necessary to remedy such invalidity.
     248This Agreement shall be interpreted under and governed by the laws of the
     249State of Washington, without regard to its rules governing the conflict of
     250laws. If any provision of this Agreement is held illegal or unenforceable
     251by a court or tribunal of competent jurisdiction, the remaining provisions
     252of this Agreement shall remain in effect and the invalid provision deemed
     253modified to the least degree necessary to remedy such invalidity.
    104254
    10525511. Entire Agreement.
    106256
    107 This Agreement is the complete agreement between GoAhead and You and supersedes all prior agreements, oral or written, with respect to the subject matter hereof.
    108 
    109 If You have any questions concerning this Agreement, You may write to GoAhead Software, Inc., 10900 N.E. 8th Street, Suite 750, Bellevue, Washington 98004 or send e-mail to info@goahead.com.
    110 
    111 BY CLICKING ON THE "Register" BUTTON ON THE REGISTRATION FORM, YOU ACCEPT AND AGREE TO BE BOUND BY ALL OF THE TERMS AND CONDITIONS SET FORTH IN THIS AGREEMENT. IF YOU DO NOT WISH TO ACCEPT THIS LICENSE OR YOU DO NOT QUALIFY FOR A LICENSE BASED ON THE TERMS SET FORTH ABOVE, YOU MUST NOT CLICK THE "Register" BUTTON.
     257This Agreement is the complete agreement between GoAhead and You and
     258supersedes all prior agreements, oral or written, with respect to the
     259subject matter hereof.
     260
     261If You have any questions concerning this Agreement, You may write to
     262GoAhead Software, Inc., 10900 N.E. 8th Street, Suite 750, Bellevue,
     263Washington 98004 or send e-mail to info@goahead.com.
     264
     265BY CLICKING ON THE "Register" BUTTON ON THE REGISTRATION FORM, YOU
     266ACCEPT AND AGREE TO BE BOUND BY ALL OF THE TERMS AND CONDITIONS SET
     267FORTH IN THIS AGREEMENT. IF YOU DO NOT WISH TO ACCEPT THIS LICENSE OR
     268YOU DO NOT QUALIFY FOR A LICENSE BASED ON THE TERMS SET FORTH ABOVE,
     269YOU MUST NOT CLICK THE "Register" BUTTON.
    112270
    113271Exhibit A
  • cpukit/httpd/md5.h

    r2f73363 ree3afa2  
    11/* MD5.H - header file for MD5C.C
     2 *
     3 * $Id$
    24 */
    35
     
    4749
    4850#endif /* _h_MD5 */
     51
  • cpukit/httpd/md5c.c

    r2f73363 ree3afa2  
    11/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
     2 *
     3 * $Id$
    24 */
    35 
  • cpukit/httpd/mime.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    2325 */
    2426
     27
    2528websMimeType websMimeList[] = {
    2629        { T("application/java"), T(".class") },
     
    3336        { T("text/css"), T(".css") },
    3437        { T("text/plain"), T(".txt") },
     38   { T("application/x-javascript"), T(".js") },
    3539
    36 #if MORE_MIME_TYPES
     40#ifdef MORE_MIME_TYPES
    3741        { T("application/binary"), T(".exe") },
    3842        { T("application/compress"), T(".z") },
  • cpukit/httpd/misc.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
    911/********************************* Includes ***********************************/
    1012
    11 #if UEMF
     13#ifdef UEMF
    1214        #include        "uemf.h"
    1315#else
     
    5052static int      dsnprintf(char_t **s, int size, char_t *fmt, va_list arg,
    5153                                int msize);
     54#if !defined(__rtems__)
     55static int      strnlen(char_t *s, unsigned int n);
     56#endif
    5257static void     put_char(strbuf_t *buf, char_t c);
    5358static void     put_string(strbuf_t *buf, char_t *s, int len,
     
    5964/*
    6065 *      "basename" returns a pointer to the last component of a pathname
    61  *  LINUX and LynxOS have their own basename function
    62  */
    63 
    64 #if ! LINUX && ! LYNX && ! __rtems__
     66 *  LINUX, LynxOS and Mac OS X have their own basename function
     67 */
     68
     69#if (!defined (LINUX) && !defined (LYNX) && !defined (MACOSX))
    6570char_t *basename(char_t *name)
    6671{
    6772        char_t  *cp;
    6873
    69 #if NW || WIN
     74#if (defined (NW) || defined (WIN))
    7075        if (((cp = gstrrchr(name, '\\')) == NULL) &&
    7176                        ((cp = gstrrchr(name, '/')) == NULL)) {
     
    8388        }
    8489}
    85 #endif /* ! LINUX & ! LYNX */
     90#endif /* ! LINUX & ! LYNX & ! MACOSX */
    8691
    8792/******************************************************************************/
     
    100105        a_assert(bufsize > 0);
    101106
    102 #if WIN || NW
     107#if (defined (WIN) || defined (NW))
    103108        if ((cp = gstrrchr(name, '/')) == NULL &&
    104109                (cp = gstrrchr(name, '\\')) == NULL)
     
    344349                                                }
    345350                                        } else {
     351                  /* 04 Apr 02 BgP -- changed so that %X correctly outputs
     352                   * uppercase hex digits when requested.
    346353                                                put_ulong(&buf, value, 16, 0, NULL, width, prec, f);
     354                   */
     355                                                put_ulong(&buf, value, 16, ('X' == c) , NULL, width, prec, f);
    347356                                        }
    348357                                }
     
    409418/******************************************************************************/
    410419/*
     420 *      Return the length of a string limited by a given length
     421 */
     422
     423#if !defined(__rtems__)
     424static int strnlen(char_t *s, unsigned int n)
     425{
     426        unsigned int    len;
     427
     428        len = gstrlen(s);
     429        return min(len, n);
     430}
     431#endif
     432
     433/******************************************************************************/
     434/*
    411435 *      Add a character to a string buffer
    412436 */
     
    528552char_t *ascToUni(char_t *ubuf, char *str, int nBytes)
    529553{
    530 #if UNICODE
     554#ifdef UNICODE
    531555        if (MultiByteToWideChar(CP_ACP, 0, str, nBytes / sizeof(char_t), ubuf,
    532556                        nBytes / sizeof(char_t)) < 0) {
     
    534558        }
    535559#else
    536         memcpy(ubuf, str, nBytes);
     560        strncpy(ubuf, str, nBytes);
    537561#endif
    538562        return ubuf;
     
    548572char *uniToAsc(char *buf, char_t *ustr, int nBytes)
    549573{
    550 #if UNICODE
     574#ifdef UNICODE
    551575        if (WideCharToMultiByte(CP_ACP, 0, ustr, nBytes, buf, nBytes, NULL,
    552576                        NULL) < 0) {
     
    554578        }
    555579#else
    556         memcpy(buf, ustr, nBytes);
     580        strncpy(buf, ustr, nBytes);
    557581#endif
    558582        return (char*) buf;
  • cpukit/httpd/ringq.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    4850/********************************* Includes ***********************************/
    4951
    50 #if UEMF
     52#ifdef UEMF
    5153        #include        "uemf.h"
    5254#else
     
    246248
    247249/******************************************************************************/
    248 #if UNICODE
     250#ifdef UNICODE
    249251/*
    250252 *      Get a byte from the queue
     
    539541        bfree(B_L, (char*) rq->buf);
    540542
    541 #if OLD
     543#ifdef OLD
    542544        rq->endp = &newbuf[endp];
    543545        rq->servp = &newbuf[servp];
  • cpukit/httpd/rom.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    2527/******************************** Local Data **********************************/
    2628
    27 #if WEBS_PAGE_ROM
     29#ifdef WEBS_PAGE_ROM
    2830
    2931sym_fd_t        romTab;                                         /* Symbol table for web pages */
  • cpukit/httpd/security.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    8284#ifdef WEBS_SSL_SUPPORT
    8385        nRet = umGetAccessLimitSecure(accessLimit);
    84         if (nRet && ((flags | WEBS_SECURE) == 0)) {
     86        if (nRet && ((flags & WEBS_SECURE) == 0)) {
    8587                websStats.access++;
    86                 websError(wp, 200, T("Access Denied\nSecure access is required."));
     88                websError(wp, 405, T("Access Denied\nSecure access is required."));
    8789                trace(3, T("SEC: Non-secure access attempted on <%s>\n"), path);
     90      /* bugfix 5/24/02 -- we were leaking the memory pointed to by
     91       * 'accessLimit'. Thanks to Simon Byholm.
     92       */
     93      bfree(B_L, accessLimit);
    8894                return 1;
    8995        }
     
    110116                if (!umUserExists(userid)) {
    111117                        websStats.access++;
    112                         websError(wp, 200, T("Access Denied\nUnknown User"));
     118                        websError(wp, 401, T("Access Denied\nUnknown User"));
    113119                        trace(3, T("SEC: Unknown user <%s> attempted to access <%s>\n"),
    114120                                userid, path);
     
    123129                                if (gstrcmp(password, userpass) != 0) {
    124130                                        websStats.access++;
    125                                         websError(wp, 200, T("Access Denied\nWrong Password"));
     131                                        websError(wp, 401, T("Access Denied\nWrong Password"));
    126132                                        trace(3, T("SEC: Password fail for user <%s>")
    127133                                                                T("attempt to access <%s>\n"), userid, path);
     
    154160                        if (gstrcmp(wp->digest, digestCalc) != 0) {
    155161                                websStats.access++;
    156                                 websError(wp, 200, T("Access Denied\nWrong Password"));
     162                                websError(wp, 405, T("Access Denied\nWrong Password"));
    157163                                nRet = 1;
    158164                        }
  • cpukit/httpd/sock.c

    r2f73363 ree3afa2  
    33 *
    44 * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
     5 *
     6 * $Id$
    57 */
    68
     
    1719#include        <stdlib.h>
    1820
    19 #if UEMF
     21#ifdef UEMF
    2022        #include        "uemf.h"
    2123#else
     
    7173                        if ((room = ringqPutBlkMax(rq)) == 0) {
    7274                                if (sp->flags & SOCKET_BLOCK) {
    73 #if WIN || CE
     75#if (defined (WIN) || defined (CE))
    7476                                        int             errCode;
    7577                                        if (! socketWaitForEvent(sp,  FD_WRITE | SOCKET_WRITABLE,
     
    100102int     socketWriteString(int sid, char_t *buf)
    101103{
    102  #if UNICODE
     104 #ifdef UNICODE
    103105        char    *byteBuf;
    104106        int             r, len;
     
    248250                        len = ringqLen(lq);
    249251                        if (len > 0) {
    250                                 *buf = ballocAscToUni(lq->servp, len);
     252                                *buf = ballocAscToUni((char *)lq->servp, len);
    251253                        } else {
    252254                                *buf = NULL;
     
    299301                                continue;
    300302                        } else if (errCode == EWOULDBLOCK || errCode == EAGAIN) {
    301 #if WIN || CE
     303#if (defined (WIN) || defined (CE))
    302304                                if (sp->flags & SOCKET_BLOCK) {
    303305                                        int             errCode;
     
    479481        *errCode = 0;
    480482
    481 #if WIN || CE
     483#if (defined (WIN) || defined (CE))
    482484        if ((sp->flags & SOCKET_ASYNC)
    483485                        && ! socketWaitForEvent(sp,  FD_CONNECT, errCode)) {
     
    491493        if (sp->flags & SOCKET_BROADCAST) {
    492494                server.sin_family = AF_INET;
    493 #if UEMF || LITTLEFOOT
     495#if (defined (UEMF) || defined (LITTLEFOOT))
    494496                server.sin_addr.s_addr = INADDR_BROADCAST;
    495497#else
     
    515517        if (bytes < 0) {
    516518                *errCode = socketGetError();
    517 #if WIN || CE
     519#if (defined (WIN) || defined (CE))
    518520                sp->currentEvents &= ~FD_WRITE;
    519521#endif
     
    523525        } else if (bytes == 0 && bytes != toWrite) {
    524526                *errCode = EWOULDBLOCK;
    525 #if WIN || CE
     527#if (defined (WIN) || defined (CE))
    526528                sp->currentEvents &= ~FD_WRITE;
    527529#endif
     
    533535 *      more data
    534536 */
    535 #if !UEMF
    536 #if WIN
     537#ifndef UEMF
     538#ifdef WIN
    537539        if (sp->interestEvents & FD_WRITE) {
    538540                emfTime_t blockTime = { 0, 0 };
     
    554556                        struct sockaddr *server)
    555557{
    556 #if VXWORKS
     558#ifdef VXWORKS
    557559        char *ptr;
    558560
     
    639641                        recv(sp->sock, buf, sizeof(buf), 0);
    640642                }
    641 #if WIN || CE
     643#if (defined (WIN) || defined (CE))
    642644                closesocket(sp->sock);
    643645#else
     
    689691int socketGetError()
    690692{
    691 #if WIN || CE
     693#if (defined (WIN) || defined (CE))
    692694        switch (WSAGetLastError()) {
    693695        case WSAEWOULDBLOCK:
  • cpukit/httpd/sym.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    1719/********************************* Includes ***********************************/
    1820
    19 #if UEMF
     21#ifdef UEMF
    2022        #include        "uemf.h"
    2123#else
  • cpukit/httpd/uemf.c

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    4749        if (etype == E_LOG) {
    4850                fmtAlloc(&buf, E_MAX_ERROR, T("%s\n"), fmtBuf);
    49 #if DEV
     51/*#ifdef DEV*/
    5052        } else if (etype == E_ASSERT) {
    5153                fmtAlloc(&buf, E_MAX_ERROR,
    5254                        T("Assertion %s, failed at %s %d\n"), fmtBuf, E_ARGS);
    53 #endif
     55/*#endif*/
    5456        } else if (etype == E_USER) {
    5557                fmtAlloc(&buf, E_MAX_ERROR, T("%s\n"), fmtBuf);
    5658        }
     59   /*
     60    * bugfix -- if etype is not E_LOG, E_ASSERT, or E_USER, the call to
     61    * bfreeSafe(B_L, buf) below will fail, because 'buf' is randomly
     62    * initialized. To be nice, we format a message saying that this is an
     63    * unknown message type, and in doing so give buf a valid value. Thanks
     64    * to Simon Byholm.
     65    */
     66   else {
     67      fmtAlloc(&buf, E_MAX_ERROR, T("Unknown error"));
     68   }
    5769        va_end(args);
    5870
  • cpukit/httpd/uemf.h

    r2f73363 ree3afa2  
    55 *
    66 * See the file "license.txt" for usage and redistribution license requirements
     7 *
     8 * $Id$
    79 */
    810
     
    1820/******************************* Per O/S Includes *****************************/
    1921
    20 #if WIN
     22#ifdef WIN
    2123        #include        <direct.h>
    2224        #include        <io.h>
     
    3436#endif /* WIN */
    3537
    36 #if CE
     38#ifdef CE
     39        #include        <errno.h>
    3740        #include        <limits.h>
    3841        #include        <tchar.h>
    3942        #include        <windows.h>
     43        #include        <winsock.h>
    4044        #include        <winnls.h>
    4145        #include        "CE/wincompat.h"
     
    4347#endif /* CE */
    4448
    45 #if NW
     49#ifdef NW
     50        #include        <direct.h>
     51        #include        <io.h>
     52        #include        <sys/stat.h>
     53        #include        <time.h>
     54        #include        <sys/types.h>
    4655        #include        <stdio.h>
     56        #include        <stdlib.h>
     57        #include        <fcntl.h>
     58        #include        <errno.h>
     59        #include        <niterror.h>
     60        #define         EINTR EINUSE
     61        #define          WEBS   1
     62        #include        <limits.h>
     63        #include        <netdb.h>
     64        #include        <process.h>
     65        #include        <tiuser.h>
     66        #include        <sys/time.h>
     67        #include        <arpa/inet.h>
     68        #include        <sys/types.h>
     69        #include        <sys/socket.h>
     70        #include        <sys/filio.h>
     71        #include        <netinet/in.h>
    4772#endif /* NW */
    4873
    49 #if SCOV5
     74#ifdef SCOV5
    5075        #include        <sys/types.h>
    5176        #include        <stdio.h>
     
    5782#endif /* SCOV5 */
    5883
    59 #if UNIX
     84#ifdef UNIX
    6085        #include        <stdio.h>
    6186#endif /* UNIX */
     
    79104#endif /* LINUX */
    80105
    81 #if LYNX
     106#ifdef LYNX
    82107        #include        <limits.h>
    83108        #include        <stdarg.h>
     
    94119#endif /* LYNX */
    95120
    96 #if UW
     121#ifdef MACOSX
     122        #include        <sys/stat.h>
     123        #include        <stdio.h>
     124        #include        <stdlib.h>
     125        #include        <unistd.h>
     126        #include        <sys/socket.h>
     127        #include        <netinet/in.h>
     128        #include        <arpa/inet.h>
     129        #include        <netdb.h>
     130        #include        <fcntl.h>
     131        #include        <errno.h>
     132#endif /* MACOSX */
     133
     134#ifdef UW
    97135        #include        <stdio.h>
    98136#endif /* UW */
    99137
    100 #if VXWORKS
     138#ifdef VXWORKS
    101139        #include        <vxWorks.h>
    102140        #include        <sockLib.h>
     
    112150#endif /* VXWORKS */
    113151
    114 #if SOLARIS
     152#ifdef SOLARIS
    115153        #include        <sys/types.h>
    116154        #include        <limits.h>
     
    128166#endif /* SOLARIS */
    129167
    130 #if QNX4
     168#ifdef QNX4
    131169        #include        <sys/types.h>
    132170        #include        <stdio.h>
     
    142180#endif /* QNX4 */
    143181
    144 #if ECOS
     182#ifdef ECOS
    145183        #include        <limits.h>
    146184        #include        <cyg/infra/cyg_type.h>
     
    157195#include        <string.h>
    158196
    159 #if ! WEBS
     197#ifndef WEBS
    160198#include        "messages.h"
    161199#endif /* ! WEBS */
     
    167205#endif
    168206
    169 #if UW
     207#ifdef UW
    170208        #define         __NO_PACK               1
    171209#endif /* UW */
    172210
    173 #if SCOV5 || VXWORKS || LINUX || LYNX || __rtems__
     211#if (defined (SCOV5) || defined (VXWORKS) || defined (LINUX) || defined (LYNX) || defined (MACOSX) || defined (__rtems__))
    174212#ifndef O_BINARY
    175213#define O_BINARY                0
    176214#endif /* O_BINARY */
    177215#define SOCKET_ERROR    -1
    178 #endif /* SCOV5 || VXWORKS || LINUX || LYNX */
    179 
    180 #if WIN || CE
     216#endif /* SCOV5 || VXWORKS || LINUX || LYNX || MACOSX */
     217
     218#if (defined (WIN) || defined (CE))
    181219/*
    182220 *      __NO_FCNTL means can't access fcntl function.  Fcntl.h is still available.
     
    194232#endif /* WIN || CE */
    195233
    196 #if LINUX && !__rtems__ && ! _STRUCT_TIMEVAL
     234#if (defined (LINUX) && !defined(__rtems__) && !defined (_STRUCT_TIMEVAL))
    197235struct timeval
    198236{
     
    203241#endif /* LINUX && ! _STRUCT_TIMEVAL */
    204242
    205 #if ECOS
     243#ifdef ECOS
    206244        #define         O_RDONLY                1
    207245        #define         O_BINARY                2
     
    219257#endif /* ECOS */
    220258
    221 #if QNX4
     259#ifdef QNX4
    222260    typedef long        fd_mask;
    223261    #define NFDBITS (sizeof (fd_mask) * NBBY)   /* bits per mask */
    224262#endif /* QNX4 */
     263
     264#ifdef NW
     265        #define fd_mask                 fd_set
     266        #define INADDR_NONE             -1l
     267        #define Sleep                   delay
     268
     269        #define __NO_FCNTL              1
     270
     271        #undef R_OK
     272        #define R_OK    4
     273        #undef W_OK
     274        #define W_OK    2
     275        #undef X_OK
     276        #define X_OK    1
     277        #undef F_OK
     278        #define F_OK    0
     279#endif /* NW */
    225280
    226281/********************************** Unicode ***********************************/
     
    234289#define XML_MAX                         4096                    /* Maximum size for tags/tokens */
    235290#define BUF_MAX                         4096                    /* General sanity check for bufs */
    236 
    237 #if LITTLEFOOT || WEBS
     291#define FMT_STATIC_MAX          256                             /* Maximum for fmtStatic calls */
     292
     293#if (defined (LITTLEFOOT) || defined (WEBS))
    238294#define LF_BUF_MAX              (510)
    239295#define LF_PATHSIZE             LF_BUF_MAX
     
    246302#ifndef CHAR_T_DEFINED
    247303#define CHAR_T_DEFINED 1
    248 #if UNICODE
     304#ifdef UNICODE
    249305/*
    250306 *      To convert strings to UNICODE. We have a level of indirection so things
     
    272328#define TSZ(x)                          (sizeof(x))
    273329#define TASTRL(x)                       (strlen(x) + 1)
    274 #if WIN
     330#ifdef WIN
    275331typedef unsigned char           uchar_t;
    276332#endif /* WIN */
     
    302358 *      here, many modules in various parts of the tree are cleaner.
    303359 */
    304 #if LITTLEFOOT && INMEM
     360#if (defined (LITTLEFOOT) && defined (INMEM))
    305361        #include        "lf/inmem.h"
    306362#endif /* LITTLEFOOT && INMEM */
     
    309365 *      Type for unicode systems
    310366 */
    311 #if UNICODE
     367#ifdef UNICODE
    312368
    313369#define gmain           wmain
     
    368424#define gtolower        towlower
    369425#define gtoupper        towupper
    370 #if CE
     426#ifdef CE
    371427#define gisspace        isspace
    372428#define gisdigit        isdigit
     
    395451#ifndef gopen
    396452#if INMEM
     453#define gchdir          imChdir
     454#define gmkdir          imMkdir
     455#define grmdir          imRmdir
    397456#define gclose          imClose
    398457#define gclosedir       imClosedir
    399 #define gchdir          imChdir
    400458#define gchmod          imChmod
    401459#define ggetcwd         imGetcwd
    402460#define glseek          imLseek
    403461#define gloadModule     imLoadModule
    404 #define gmkdir          imMkdir
    405462#define gopen           imOpen
    406463#define gopendir        imOpendir
     
    408465#define greaddir        imReaddir
    409466#define grename         imRename
    410 #define grmdir          imRmdir
    411467#define gstat           imStat
    412468#define gunlink         imUnlink
    413469#define gwrite          imWrite
    414470#else
    415 #define gclose          close
    416 #define gclosedir       closedir
    417471#if VXWORKS
    418472#define gchdir          vxchdir
    419473#define gmkdir          vxmkdir
    420474#define grmdir          vxrmdir
     475#elif (defined (LYNX) || defined (LINUX) || defined (MACOSX) || defined (SOLARIS))
     476#define gchdir          chdir
     477#define gmkdir(s)       mkdir(s,0755)
     478#define grmdir          rmdir
    421479#else
    422 #if LYNX || LINUX || SOLARIS
    423 #define gmkdir(s)       mkdir(s,0755)
    424 #else
     480#define gchdir          chdir
    425481#define gmkdir          mkdir
    426 #endif /* LYNX || LINUX || SOLARIS */
    427482#define grmdir          rmdir
    428 #define gchdir          chdir
    429 #endif /* VXWORKS */
     483#endif /* VXWORKS #elif LYNX || LINUX || MACOSX || SOLARIS*/
     484#define gclose          close
     485#define gclosedir       closedir
    430486#define gchmod          chmod
    431487#define ggetcwd         getcwd
     
    501557#define gmain           main
    502558#endif /* ! VXWORKS */
    503 #if VXWORKS
     559#ifdef VXWORKS
    504560#define fcntl(a, b, c)
    505561#endif /* VXWORKS */
    506562#endif /* ! UNICODE */
    507563
     564/*
     565 *      Include inmem.h here because it redefines many of the file access fucntions.
     566 *      Otherwise there would be lots more #if-#elif-#else-#endif ugliness.
     567 */
     568#ifdef INMEM
     569        #include        "lf/inmem.h"
     570#endif
     571
    508572/********************************** Defines ***********************************/
    509573
     
    526590#define E_ARGS                          file, line
    527591
    528 #if ASSERT || ASSERT_CE
     592#if (defined (ASSERT) || defined (ASSERT_CE))
    529593        #define a_assert(C)             if (C) ; else error(E_L, E_ASSERT, T("%s"), T(#C))
    530594#else
     
    571635                long    octal;
    572636                long    big[2];
    573 #if FLOATING_POINT_SUPPORT
     637#ifdef FLOATING_POINT_SUPPORT
    574638                double  floating;
    575639#endif /* FLOATING_POINT_SUPPORT */
     
    580644        } value;
    581645
    582         vtype_t                 type            : 16;
     646        vtype_t                 type;
    583647        unsigned int    valid           : 8;
    584648        unsigned int    allocated       : 8;            /* String was balloced */
     
    750814 */
    751815
    752 #if (WIN || CE) && WEBS
     816#if ((defined (WIN) || defined (CE)) && defined (WEBS))
    753817#define EWOULDBLOCK             WSAEWOULDBLOCK
    754818#define ENETDOWN                WSAENETDOWN
     
    756820#endif /* (WIN || CE) && WEBS) */
    757821
    758 #define SOCKET_EOF                              0x1                     /* Seen end of file */
    759 #define SOCKET_CONNECTING               0x2                     /* Connect in progress */
    760 #define SOCKET_BROADCAST                0x4                     /* Broadcast mode */
    761 #define SOCKET_PENDING                  0x8                     /* Message pending on this socket */
    762 #define SOCKET_FLUSHING                 0x10            /* Background flushing */
    763 #define SOCKET_DATAGRAM                 0x20            /* Use datagrams */
    764 #define SOCKET_ASYNC                    0x40            /* Use async connect */
    765 #define SOCKET_BLOCK                    0x80            /* Use blocking I/O */
    766 #define SOCKET_LISTENING                0x100           /* Socket is server listener */
    767 #define SOCKET_CLOSING                  0x200           /* Socket is closing */
    768 
    769 #define SOCKET_PORT_MAX                 0xffff          /* Max Port size */
     822#define SOCKET_EOF                              0x1             /* Seen end of file */
     823#define SOCKET_CONNECTING               0x2             /* Connect in progress */
     824#define SOCKET_BROADCAST                0x4             /* Broadcast mode */
     825#define SOCKET_PENDING                  0x8             /* Message pending on this socket */
     826#define SOCKET_FLUSHING                 0x10    /* Background flushing */
     827#define SOCKET_DATAGRAM                 0x20    /* Use datagrams */
     828#define SOCKET_ASYNC                    0x40    /* Use async connect */
     829#define SOCKET_BLOCK                    0x80    /* Use blocking I/O */
     830#define SOCKET_LISTENING                0x100   /* Socket is server listener */
     831#define SOCKET_CLOSING                  0x200   /* Socket is closing */
     832#define SOCKET_CONNRESET                0x400   /* Socket connection was reset */
     833
     834#define SOCKET_PORT_MAX                 0xffff  /* Max Port size */
    770835
    771836/*
    772837 *      Socket error values
    773838 */
    774 #define SOCKET_WOULDBLOCK               1                       /* Socket would block on I/O */
    775 #define SOCKET_RESET                    2                       /* Socket has been reset */
    776 #define SOCKET_NETDOWN                  3                       /* Network is down */
    777 #define SOCKET_AGAIN                    4                       /* Issue the request again */
    778 #define SOCKET_INTR                             5                       /* Call was interrupted */
    779 #define SOCKET_INVAL                    6                       /* Invalid */
     839#define SOCKET_WOULDBLOCK               1               /* Socket would block on I/O */
     840#define SOCKET_RESET                    2               /* Socket has been reset */
     841#define SOCKET_NETDOWN                  3               /* Network is down */
     842#define SOCKET_AGAIN                    4               /* Issue the request again */
     843#define SOCKET_INTR                             5               /* Call was interrupted */
     844#define SOCKET_INVAL                    6               /* Invalid */
    780845
    781846/*
    782847 *      Handler event masks
    783848 */
    784 #define SOCKET_READABLE                 0x2                     /* Make socket readable */
    785 #define SOCKET_WRITABLE                 0x4                     /* Make socket writable */
    786 #define SOCKET_EXCEPTION                0x8                     /* Interested in exceptions */
     849#define SOCKET_READABLE                 0x2             /* Make socket readable */
     850#define SOCKET_WRITABLE                 0x4             /* Make socket writable */
     851#define SOCKET_EXCEPTION                0x8             /* Interested in exceptions */
    787852#define EMF_SOCKET_MESSAGE              (WM_USER+13)
    788853
    789 #if LITTLEFOOT
    790 #define SOCKET_BUFSIZ                   510                     /* Underlying buffer size */
     854#ifdef LITTLEFOOT
     855#define SOCKET_BUFSIZ                   510             /* Underlying buffer size */
    791856#else
    792 #define SOCKET_BUFSIZ                   1024            /* Underlying buffer size */
     857#define SOCKET_BUFSIZ                   1024    /* Underlying buffer size */
    793858#endif /* LITTLEFOOT */
    794859
     
    831896 */
    832897
    833 #if NO_BALLOC
     898#ifdef NO_BALLOC
    834899#define balloc(B_ARGS, num) malloc(num)
    835900#define bfree(B_ARGS, p) free(p)
     
    852917#define bstrdup(B_ARGS, p) bstrdup(p)
    853918
    854 #if UNICODE
     919#ifdef UNICODE
    855920#define bstrdupA(B_ARGS, p) bstrdupA(p)
    856921#else /* UNICODE */
     
    867932extern char_t   *bstrdup(B_ARGS_DEC, char_t *s);
    868933
    869 #if UNICODE
     934#ifdef UNICODE
    870935extern char *bstrdupA(B_ARGS_DEC, char *s);
    871936#else /* UNICODE */
     
    882947#define B_USER_BUF                      0x2                             /* User supplied buffer for mem */
    883948
     949
    884950#if !LINUX && !__rtems__
    885951extern char_t   *basename(char_t *name);
    886952#endif /* !LINUX */
    887953
    888 #if UEMF && WEBS
     954#if (defined (UEMF) && defined (WEBS))
    889955/*
    890956 *      The open source webserver uses a different callback/timer mechanism
     
    909975                                        (int etype, char_t *msg);
    910976
    911 #if B_STATS
     977#ifdef B_STATS
    912978#define                 hAlloc(x)                               HALLOC(B_L, x)
    913979#define                 hAllocEntry(x, y, z)    HALLOCENTRY(B_L, x, y, z)
     
    9341000extern int              fmtStatic(char_t *s, int n, char_t *fmt, ...);
    9351001
    936 #if UNICODE
     1002#ifdef UNICODE
    9371003extern int              ringqPutcA(ringq_t *rq, char c);
    9381004extern int              ringqInsertcA(ringq_t *rq, char c);
  • cpukit/httpd/um.c

    r2f73363 ree3afa2  
    5454/******************************** Local Data **********************************/
    5555
     56#ifdef qHierarchicalAccess
     57/*
     58 * user-provided function to allow hierarchical access protection. See below.
     59 * for details.
     60 */