Compiling reject_trace.c via NSAPI on HP-UX

After a PCI scan on one of our HP-UX 11.23 servers, we discovered we have an issue with our Netscape/Sun iPlanet 4.1 build with HTTP Trace/Track still enabled. It seems we can solve the problem by compiling an NSAPI module called 'reject_trace.c', but upon attempting to compile the source code, we keep running into this error as seen below.

I have attached the Makefile, reject_trace.c and nsapi.h (in txt form) for reference/review needs.

Here is a link to the original instructions:
http://unix.derkeiler.com/Mailing-Lists/HP-UX-Admin/2003-06/0082.html

$ make
        cc -DXP_Unix -DMCC_HTTPD -DNET_SSL -DHPUX -D_HPUX_SOURCE -Aa +DA1.0 +z -c   -I../../include -I../../include/base -I../../include/frame -c reject_trace.c 
(Bundled) cc: warning 480: The -A option is available only with the C/ANSI C product; ignored.
(Bundled) cc: warning 480: The +z option is available only with the C/ANSI C product; ignored.
(Bundled) cc: "../../include/nsapi.h", line 597: error 1000: Unexpected symbol: "Func".
(Bundled) cc: panic 2017: Cannot recover from earlier errors, terminating.
*** Error exit code 1

Open in new window

Makefile.txt
nsapi.h.txt
reject-trace.c.txt
LVL 29
Michael WorshamInfrastructure / Solutions ArchitectAsked:
Who is Participating?
 
jkrConnect With a Mentor Commented:
Seems a little thing with a big effect - you are using "-DXP_Unix", try adding "-DXP_UNIX". Compilers and source code are case sensitive.
0
 
Infinity08Connect With a Mentor Commented:
Instead of :

         /*
          * FuncPtr is a pointer to our kind of functions
          */
         
         #ifdef XP_UNIX
         typedef int Func(pblock *, Session *, Request *);
         #else
         typedef int _cdecl Func(pblock *, Session *, Request *);
         #endif
         
         typedef Func *FuncPtr;

try :

         /*
          * FuncPtr is a pointer to our kind of functions
          */
         
         #ifdef XP_UNIX
         typedef int (*FuncPtr)(pblock *, Session *, Request *);
         #else
         typedef int _cdecl (*FuncPtr)(pblock *, Session *, Request *);
         #endif

It shouldn't be necessary, but maybe the compiler doesn't like it.
0
 
Infinity08Commented:
>> you are using "-DXP_Unix", try adding "-DXP_UNIX"

That would explain it too ;)
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Michael WorshamInfrastructure / Solutions ArchitectAuthor Commented:
Ok, fixed that part. Here is the error I am getting now:


        cc -DMCC_HTTPD -DXP_UNIX -DNET_SSL -DHPUX -D_HPUX_SOURCE +DA1.0 -I/opt/netscape41.mcc6/plugins/include -I/opt/netscape41.mcc6/include/base -I/opt/netscape41.mcc6/include/frame -I/opt/netscape41.mcc6/include/nsacl -c reject_trace.c -o reject_trace.o
(Bundled) cc: "/opt/netscape41.mcc6/plugins/include/base/../nsapi.h", line 595: error 1000: Unexpected symbol: "*".
(Bundled) cc: "/opt/netscape41.mcc6/plugins/include/base/../nsapi.h", line 595: error 1000: Unexpected symbol: "*".
(Bundled) cc: "/opt/netscape41.mcc6/plugins/include/base/../nsapi.h", line 595: error 1705: Function prototypes are an ANSI feature.
(Bundled) cc: "/opt/netscape41.mcc6/plugins/include/base/../nsapi.h", line 595: error 1573: Type of "<<<NULL_SYMBOL>>>" is undefined due to an illegal declaration.
(Bundled) cc: "/opt/netscape41.mcc6/plugins/include/base/../nsapi.h", line 600: error 1000: Unexpected symbol: "*".
(Bundled) cc: "/opt/netscape41.mcc6/plugins/include/base/../nsapi.h", line 611: warning 5: "const" will become a keyword.
(Bundled) cc: "/opt/netscape41.mcc6/plugins/include/base/../nsapi.h", line 600: error 1584: Inconsistent type declaration: "Func".
(Bundled) cc: "/opt/netscape41.mcc6/plugins/include/base/../nsapi.h", line 600: warning 525: Redeclaration of identifier "Func".
(Bundled) cc: "/opt/netscape41.mcc6/plugins/include/base/../nsapi.h", line 611: error 1000: Unexpected symbol: "const".
(Bundled) cc: "/opt/netscape41.mcc6/plugins/include/base/../nsapi.h", line 612: error 1000: Unexpected symbol: "func".
(Bundled) cc: "/opt/netscape41.mcc6/plugins/include/base/../nsapi.h", line 617: error 1000: Unexpected symbol: "}".
(Bundled) cc: "/opt/netscape41.mcc6/plugins/include/base/../nsapi.h", line 947: warning 5: "const" will become a keyword.
(Bundled) cc: "/opt/netscape41.mcc6/plugins/include/base/../nsapi.h", line 947: error 1000: Unexpected symbol: "char".
(Bundled) cc: panic 2017: Cannot recover from earlier errors, terminating.
*** Error exit code 1

Open in new window

0
 
Infinity08Commented:
>> Ok, fixed that part.

If you made the modification I suggested, then try undoing it.
0
 
Infinity08Commented:
If you didn't, then try replacing it ;)
0
 
Michael WorshamInfrastructure / Solutions ArchitectAuthor Commented:
Actually we found the problem.

It seems on one of our boxes where we originally compiled it, the 'bundled' HP-UX cc compiler didn't work. So we copied the reject_trace.c file to an HP-UX with Ansi/C installed and tried compiling it. It bugged out at first cause the compiler required the Makefile to have -Aa and +z in the C_FLAGS.

Fixed the Makefile and tried again. Compiled successfully!

We copied the compiled shared object (reject_trace.so) over back to the issue machine and installed it into the iPlanet obj.conf and restarted the iPlanet instance. Module is now working.

Thanks for the 2nd pair of eyes for pointing out the XP_UNIX issue.

        cc -DMCC_HTTPD -DXP_UNIX -DNET_SSL -DHPUX -D_HPUX_SOURCE -Aa +DA1.0 +z -I/opt/netscape41.mcc6/plugins/include -I/opt/netscape41.mcc6/include/base -I/opt/netscape41.mcc6/include/frame -I/opt/netscape41.mcc6/include/nsacl -c reject_trace.c -o reject_trace.o
        cc -DMCC_HTTPD -DXP_UNIX -DNET_SSL -DHPUX -D_HPUX_SOURCE -Aa +DA1.0 +z -I/opt/netscape41.mcc6/plugins/include -I/opt/netscape41.mcc6/include/base -I/opt/netscape41.mcc6/include/frame -I/opt/netscape41.mcc6/include/nsacl -o reject_trace.so reject_trace.o -b
        cc -DMCC_HTTPD -DXP_UNIX -DNET_SSL -DHPUX -D_HPUX_SOURCE -Aa +DA1.0 +z -I/opt/netscape41.mcc6/plugins/include -I/opt/netscape41.mcc6/include/base -I/opt/netscape41.mcc6/include/frame -I/opt/netscape41.mcc6/include/nsacl -o reject_trace.so reject_trace.o -b

Open in new window

0
All Courses

From novice to tech pro — start learning today.