Results 1 to 10 of 11
I have an SSI directive to execute a CGI script, when the scritp executes it calls lynx as
`TEMP=lynx --source http://www.google.com`
echo $TEMP
and proceeds to bomb out with permission ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-28-2002 #1Linux User
- Join Date
- Jul 2002
- Location
- Daytona Beach, FL
- Posts
- 487
who broke lynx!!
I have an SSI directive to execute a CGI script, when the scritp executes it calls lynx as
`TEMP=lynx --source http://www.google.com`
echo $TEMP
and proceeds to bomb out with permission errors, the only way to solve this is to give apache write permission to the /var/www/ (httpd default directory) - it would appear that lynx is wriring a temp file there
/var/www/4FwfoS: Permission denied is the result of the echo command - even weirder is this
lynx --source http://www.google.com > /tmp/google_file
then after the script,
cat /tmp/google_file throws the same error! (Although the garbage oart changes) - any ideas? I have given apache ownerwhip of /var/www/ in the meantime but...majorwoo
Quiet brain, or I\'ll stab you with a Q-tip.
- 12-28-2002 #2Linux Enthusiast
- Join Date
- Jun 2002
- Location
- San Antonio
- Posts
- 621
first off, isn't it lynx -source not --source? secondly, strace it, see what happens. try `strace -e open lynx google.com > this`
I respectfully decline the invitation to join your delusion.
- 12-28-2002 #3Linux User
- Join Date
- Jul 2002
- Location
- Daytona Beach, FL
- Posts
- 487
no, it is --source
well i thought it was classic permission problem, because when i run it from the command line the script works fine, but when it is invoked via a SSI direcive over the web browser it bombs out
your strace gave me the same thing
[root@daboss cgi-bin]# cat /tmp/this
/var/www/zdcvoC: Permission denied
the weird part is this looks like the errors from a C compiler when you misquote "", but i have checked that - and if apache owns the /var/www/ it works fine every time (or i can give the world write access, wonder why i dont do that)
The part i dont get, is i really dont want to write it to a file, i wanted to save it to a variable
TEMP=`lynx --source http://www.google.com`
so that i can then do some parsing on the html, when i do that and try to echo the variable it contains the same junk:
/var/www/zdcvoC: Permission deniedmajorwoo
Quiet brain, or I\'ll stab you with a Q-tip.
- 12-28-2002 #4Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
No, it's lynx -source (at least on my lynx...)
Anyway, I'd first try using wget instead, but I agree, that's a dirty solution. {s,l}trace it instead, and see why it goes wrong.
It would seem lynx tries to save it to a temp file before it outputs it, but that would be stupid, and why would it want to store the file to /var/www? Weird... It's like it wants to save the temp file to its home dir or something... Anyway, {s,l}tracing is bound to reveal something. Complete that with gdb and the source, too, and you'll have a winning solution...
- 12-28-2002 #5Linux Enthusiast
- Join Date
- Jun 2002
- Location
- San Antonio
- Posts
- 621
or download the srpm and look through the source for a hardcoded /var/www? Too bad I don't use lynx or RedHat, so I can't tell you even remotely what might be wrong. Try that strace again, and tell me what is output from:
strace -e open lynx google.com 1>this 2>that
Now, read the file "that" it will contain a log of every file lynx tried to open. Not that it would make much difference to know that it tried to open it, but there might be a line in lynx.conf (in /usr/etc I think) to say where to store temp files? Maybe man lynx.confI respectfully decline the invitation to join your delusion.
- 12-28-2002 #6Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
To check for hardcoded strings, I'd rather recommend strings /usr/bin/lynx | grep /var/www instead of downloading the source.
But strace -e? My strace doesn't support a -e option... What version do you have? I agree, it's no good knowing that it tried to open the file, that we already know. Try ltrace instead, and you might get some getpwent's or strcat or something to tell what it's doing.
As a last resort though, try strace -i lynx -source google.com 2>&1 | grep open | grep /var/www to get where it tries to open that file, then download the source and addr2line that address and see the source as to why it does that.
- 12-28-2002 #7Linux Enthusiast
- Join Date
- Jun 2002
- Location
- San Antonio
- Posts
- 621
see, that is something I would have _never_ thought of doing Dolda. Good call though, Josh is resourceful, he will probably solve the issue rather quickly once he gets time.
Ideas like those are why admins do much better in pairs.I respectfully decline the invitation to join your delusion.
- 12-28-2002 #8Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
Well, I'd be glad to get even a single admin job. Right now, I'm working as cashier at a local grocery store, and I'm bored out of my wits and sanity.
- 12-29-2002 #9Linux User
- Join Date
- Jul 2002
- Location
- Daytona Beach, FL
- Posts
- 487
Yeah i will try the traces on it, i have actually never used them before - i tried the strace option you gave me at first sam, but the file just contained the same /var/www/Sjfewi Permission denied stuff
lynx --source works for me, as does lynx-source odly enough, i was almost positive -source didn't work last night. It is pretty tuff as I am still fighting with my man pages in redhat 8,0 - when i open one the characters go to hell, specifically the gets replaced with a square, and i havent had time to fix it - my family is visiting, so i answer posts for 10 minnutes at night and go to bed - maybe in January
Dolda - well for a cashier you seem to know your stuff, did you used to admin, or just a self-taught?majorwoo
Quiet brain, or I\'ll stab you with a Q-tip.
- 12-29-2002 #10Linux Enthusiast
- Join Date
- Jun 2002
- Location
- San Antonio
- Posts
- 621
Dodla: if it makes you feel any better, I wait tables at a chain restaurant. Hooray for being really good with computers and working crap jobs
I respectfully decline the invitation to join your delusion.


Reply With Quote
