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 WorshamStaff Infrastructure ArchitectAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jkrCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Infinity08Commented:
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
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Michael WorshamStaff Infrastructure 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 WorshamStaff Infrastructure 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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.