[HPADM] RE: HTTP Trace for ns-httpd

From: Fong, Anna (anna_at_water.ca.gov)
Date: 06/24/03

  • Next message: BAKHSHESH Kazem: "[HPADM] ignite"
    Date: Tue, 24 Jun 2003 11:56:26 -0700
    To: "Johnson, Craig E" <Craig.E.Johnson@icn.siemens.com>, <hpux-admin@DutchWorks.nl>
    
    

    Craig,
     
    Found Sun Alert regarding HTTP Trace for iPlanet -- http://sunsolve.Sun.COM/pub-cgi/retrieve.pl?type=0 <http://sunsolve.Sun.COM/pub-cgi/retrieve.pl?type=0&doc=fsalert%2F50603&display=plain> &doc=fsalert%2F50603&display=plain
     
    I believe the solution listed for iPlanet 4.1 can also be implemented for NES. Under your server root directory, there should be an example -- /nsapi/examples/auth.c for creating an NSAPI.
     
     
    Summary of solution from above
    -----------------------------------------------
     
     
    1) Create a file called reject_trace.c and paste the code below into it
            ----------------------------- start --------------------------------
     
            #include "nsapi.h"
     
            NSAPI_PUBLIC int reject_trace(pblock *pb, Session *sn, Request *rq)
            {
                    const char *method;
     
                    method = pblock_findval("method", rq->reqpb);
                    if (method && !strcmp(method, "TRACE")) {
                    /*
                    * Set a bogus content length so the TRACE handler will refuse to
                    * handle the request
                    */
                 param_free(pblock_remove("transfer-encoding",rq->headers));
                 param_free(pblock_remove("content-length", rq->headers));
                 pblock_nvinsert("content-length", "-1", rq->headers);
     
                 log_error(LOG_WARN, "reject-trace", sn, rq, "rejecting TRACE request");
     
                 protocol_status(sn, rq, PROTOCOL_NOT_IMPLEMENTED, NULL);
     
                 return REQ_ABORTED;
             }
     
            return REQ_NOACTION;
            }
            ----------------------- end --------------------------------
     
     
    2) Compile the NSAPI:

               <http://docs.sun.com/source/816-5673-10/04_mysaf.htm#15053(4.x> http://docs.sun.com/source/816-5673-10/04_mysaf.htm#15053(4.x)
     
     
    3) Edit the obj.conf and add to the end of the Init section:
     
            Init fn="load-modules" shlib="<path to library>/reject_trace.so"funcs="reject_trace"
     
    Then after the line <Object name="default"> add the following
     
            AuthTrans fn="reject_trace"
     
     

    -----Original Message-----
    From: Johnson, Craig E [mailto:Craig.E.Johnson@icn.siemens.com]
    Sent: Friday, June 20, 2003 2:34 PM
    To: 'hpux-admin@DutchWorks.nl'
    Subject: [HPADM] HTTP Trace for ns-httpd

    Does anyone know how to disable HTTP Trace for the Netscape webserver? Details appreciated. Thanks.
     
    Craig
     

    --
                 ---> Please post QUESTIONS and SUMMARIES only!! <---
            To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
           Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
     
     Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
                http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)
    

  • Next message: BAKHSHESH Kazem: "[HPADM] ignite"