[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] cgi
> ive written and compiled the program:
> #include <stdlib.h>
> int main ()
> {
> system ("/path/to/my/cgi-script");
> return 0;
> }
>
> but havent done C on unix ( it was clunky OS9) for ages and dont have my uni
> notes anymore and dont know how to invoke a sell command as uid root using
> system ("/usr/local/httpd/cgi-bin/test.cgi");
> could u help or point me to a web site for basics on C on unix or possibly
> recomend a good book for basic C programming on linux/unix.
? unsure what you're unsure about -- the instructions given in last mail
should (no - will) give you suid capabilities for the script given in the
system command. system() will invoke the command passed into it (in your
case, /usr/local/httpd/cgi-bin/test.cgi) via /bin/sh. I am assuming you've
copied the wrapper program into /usr/local/httpd/cgi-bin, and you've tried
running the wrapper via http (ie, http://your.server/cgi-bin/cgi-wrapper ...
where cgi-wrapper is whatever you decided to call it). Try typing "man 3
system" and see if that helps.
I don't know any good books or web sites (not teach-yourself ones) ... I
taught myself C with Turbo C V2.0 from Borland, using nothing much mroe than
the help screens, and UNIX with the man pages and also the book "Newnes UNIX
Pocket Book", which *is* a good book, but its more a reference than a
teach-yourself (I prefer learning from reference books ... the hold their
usefulness beyond the "teach yourself" phase).
Chris...
--
@}-,'-------------------------------------------------- Chris Johnson --'-{ [at]
/ "(it is) crucial that we learn the difference / sixie [at] nccnet.co.uk \
/ between Sex and Gender. Therein lies the key / \
/ to our freedom" -- LB / www.nccnet.co.uk/~sixie \
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word
"unsubscribe" in the body of the message.
GNU the choice of a complete generation.