Question about system() call malfunctioning (Was: Question: system() from C++ CGI to Perl with Kernel 2.2.16)

Question about system() call malfunctioning (Was: Question: system() from C++ CGI to Perl with Kernel 2.2.16)

Post by Lisa Wilco » Fri, 21 Jul 2000 04:00:00



Hello all,

I've done some more testing (see MORE INFO Re: Question: system() from
C++ CGI to Perl with Kernel 2.2.1) and it seems like the syscall
(system()) from my C++ CGI to my Perl module is not working.  To sum up,
the C++ CGI is working as expected, but the output from the Perl module
called by system() is not presenting back to the user.  I'm getting a
large return value from the syscall (33,000+, depending on the query
appended to the string/command).  I suspect that the Perl script is
actually being run, because malfunctioning syscalls from that are
logging to /var/log/httpd/error_log.  I resolved those and they
disappeared from the logs.  However, no other messages are being logged.

My research into what this means leads me to conclude that the program
runs the syscall, but for whatever reason it returns an error.  Could
this be because the output is going somewhere other than STDOUT?

Using strace wasn't very useful to me because I can't run the C++ CGI
from the command line.  (It's programmed to parse only GET or POST
method requests.) I did use strace on the executable file without the
arguments just to see what I
would get, and found no differences between the version that works and
the one that does not.

Any ideas on where to go from here would be appreciated.

--
Lisa Wilcox
SAGE Systems Developer
SAGE Project:  http://sage.library.emory.edu/
Woodruff Library/Emory University

Phone: 404-727-0961

 
 
 

Question about system() call malfunctioning (Was: Question: system() from C++ CGI to Perl with Kernel 2.2.16)

Post by Lisa Wilco » Fri, 21 Jul 2000 04:00:00


Thanks.  We tried popen().  Interestingly, when run from a script at the command
line (not the same script, but something we threw together fast just to see if it
would work), it worked fine.  When run from the CGI, however, we could not
retrieve the output.


> I did not understand all the details of your problem. However I? might
> suggest using popen instead of system (and of course copying the
> output read by popen into your CGI output)

> N.B. Any opinions expressed here are only mine, and not of my organization.
> N.B. Les opinions exprimees ici me sont personnelles et n engagent pas le CEA.

> ---------------------------------------------------------------------
> Basile STARYNKEVITCH   ----  Commissariat l Energie Atomique
> DTA/LETI/DEIN/SLA * CEA/Saclay b.528 (p111f) * 91191 GIF/YVETTE CEDEX * France
> phone: 1,69.08.60.55; fax: 1.69.08.83.95 home: 1,46.65.45.53
> email: Basile point Starynkevitch at cea point fr

--
Lisa Wilcox
SAGE Systems Developer
SAGE Project:  http://sage.library.emory.edu/
Woodruff Library/Emory University

Phone: 404-727-0961

 
 
 

Question about system() call malfunctioning (Was: Question: system() from C++ CGI to Perl with Kernel 2.2.16)

Post by Mario Klebs » Fri, 21 Jul 2000 04:00:00



>Using strace wasn't very useful to me because I can't run the C++ CGI
>from the command line.  (It's programmed to parse only GET or POST
>method requests.)

You should have used strace -f -o tracefile on the httpd.

73, Mario
--

PGP-Key available at http://www.klebsch.de/public.key
Fingerprint DSS: EE7C DBCC D9C8 5DC1 D4DB  1483 30CE 9FB2 A047 9CE0
 Diffie-Hellman: D447 4ED6 8A10 2C65 C5E5  8B98 9464 53FF 9382 F518

 
 
 

1. Question: system() from C++ CGI to Perl with Kernel 2.2.16

Hello all,

I've got a C++ CGI making a syscall to a Perl program on a Red Hat Linux

test server with kernel 2.2.5, and working beautifully.  On another
system where the main difference is the kernel (2.2.16), it doesn't work

at all.  I have combed through all relevant logs in /var/log and there
are no error messages whatsoever.  It appears to be running the Perl
program, as error messages from its system calls are being logged to
/var/log/httpd/error_log.  I've tried using popen() instead, with no
success.  The C++ CGI compiles cleanly and runs as expected with
exception of the system call.  The Perl program runs as expected when
run from the command line.

What's the problem?!?!  Is this a security issue?  Is this just a bug
and all I need is a patch?  I'm using Perl 5.005_03, glibc 2.1.2-11,
apache 1.3.12, and compiling with g++.  I *really* don't want to embed a

Perl interpreter because I think its overkill for what I'm trying to
do.  However, if the problem is a security issue blocking the execution,

either within Apache or the kernel, I would be willing to do it.  If
someone could recommend an example that makes sense, I would appreciate
it.  All I want to do is run the program and have the results print back

to the user.

Any solutions to the problem would be joyously received.

Thanks,

--
Lisa Wilcox
SAGE Systems Developer
SAGE Project:  http://sage.library.emory.edu/
Woodruff Library/Emory University

Phone: 404-727-0961

2. Is Man Good?

3. Monitoring NIS usage

4. Help With IP Masquerading

5. need help with kernel patching 2.2.16 -> 2.2.16-1

6. Where is the documents about pcmcia module??

7. kernel 2.2.16 questions

8. Upgrading kernel 2.2.12 to kernel 2.2.16, keeping same options

9. ? NCSA CGI eats output from PERL system() calls

10. Perl CGI with System Call in background doesnt return immediately

11. IBM 16/4 PCI token ring adapter 2 on 2.2.16