Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

system call returns return code -1

137 views
Skip to first unread message

ganesh

unread,
Sep 11, 2006, 1:58:38 AM9/11/06
to
Hi,

i have a cgi file and in that i am calling the system('ls')
system('ls');
its returning a return code of -1 ,permission denied.

so i added apache user having permissions to execute the ls command in
/etc/sudoers file.
and relaced the system function with
system("sudo","ls");
still i am getting the above same error.

can anyone help me out in solving this.

thanks.


--
PLEASE NOTE: comp.infosystems.www.authoring.cgi is a
SELF-MODERATED newsgroup. aa.net and boutell.com are
NOT the originators of the articles and are NOT responsible
for their content.

HOW TO POST to comp.infosystems.www.authoring.cgi:
http://www.thinkspot.net/ciwac/howtopost.html

Chris Davies

unread,
Sep 12, 2006, 5:08:32 PM9/12/06
to
ganesh <gmac...@gmail.com> wrote:
> i have a cgi file and in that i am calling the system('ls')
> its returning a return code of -1 ,permission denied.

What language is your CGI script written in? Presumably this is on a
UNIX box? What makes you think that when system() returns -1 it's a
"permission denied" error on the program itself?

Incidentally, do you know for sure what directory the CGI process is
actually executing in? (Not executing *from*, but executing *in*.)


> so i added apache user having permissions to execute the ls command in
> /etc/sudoers file.

Arrgghh. What reasoning did you apply to determine that the apache user
didn't have permissions to run "ls"?

Chris

0 new messages