This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Calling shell from server application - please help.
- To: "'Gnu Mailing list'" <gnu-win32 at cygnus dot com>
- Subject: Calling shell from server application - please help.
- From: Ian Collins <Ian at kiwiplan dot co dot nz>
- Date: Mon, 25 May 1998 12:39:53 +1200
I have a client server application whose server end is running in the
Gnu-Win32 environment.
I start this process from inetd. I have an entry in services as,
kidd 2326/tcp #Kiwiplan ISAM database server
and an entry in inetd.conf as,
kidd stream tcp nowait root /usr3/ian/kids/kidd kidd
The kidd process starts fine (just like Unix!).
This process has an internal protocol that gets information from the
client, authenticates it, and then starts another process (dependant on
the authentication information). I start this second process using,
sexeclp(hToken, myproc, argvv, 0);
(I got hToken from the NT authentication).
Again, this process starts fine, and for 99% of it's functionality works
like a dream.
HOWEVER (theres always a "however'), part of the servers functionality
is to access the operating system via shell scripts (for example, when
it has to sort a file, it calls a shell script).
EVERY TIME, A SHELL SCRIPT IS EXECUTED, AN ERROR IS GENERATED,
"Permission Denied".
I created a test harness that allows the client to request an
application to be executed by the server to try to isolate the problem.
I told it to execute a script called "ian".
All "ian" does is,
echo Hello World > /usr3/ian/ian.out
It responds with "ian: Permission Denied".
I know I have a valid PATH setup.
I have tried putting a #!/bin/sh in "ian".
I have setup a valid SHELL variable in the server app.
If my client tells the server to execute a program like for instance,
"mount", then it works fine.
More information:
I was using "system" to execute the scripts. I changed this to a "fork"
and "execvp", and hey Presto, the scripts work!
HOWEVER, if those scripts call any other scipts (or programs), then
those programs fail!
PLEASE HELP!
Ian Collins.
KIWIPLAN NZ.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".