mod_ruby require LoadError

R

Richard Turner

Hi,

I'm trying to require a file in a mod_ruby script I'm running and,
although I've eliminated the SecurityError that was being thrown by
untainting the string I've added to $:, now I see a LoadError instead.
Here's a snippet of the code:

def displaySections
$:.unshift("/home/rjt/sara/trunk/src/client/".untaint)
require 'soap/rpc/driver'
require 'page'
...
end

The error, from Apache's log, is:

[Wed Jan 26 10:49:19 2005] [error]
mod_ruby: /home/rjt/sara/trunk/src/public_html/sections.rbx:33:in
`require': No such file to load -- page (LoadError)

The script works fine from the command-line unless I set $SAFE = 3 (i.e.
it still works with $SAFE = 1 and $SAFE = 2).

I am perplexed :(

Cheers,

Richard.
 
R

Richard Turner

Hi,

I'm trying to require a file in a mod_ruby script I'm running and,
although I've eliminated the SecurityError that was being thrown by
untainting the string I've added to $:, now I see a LoadError instead.
Here's a snippet of the code:

def displaySections
$:.unshift("/home/rjt/sara/trunk/src/client/".untaint)
require 'soap/rpc/driver'
require 'page'
...
end

The error, from Apache's log, is:

[Wed Jan 26 10:49:19 2005] [error]
mod_ruby: /home/rjt/sara/trunk/src/public_html/sections.rbx:33:in
`require': No such file to load -- page (LoadError)

The script works fine from the command-line unless I set $SAFE = 3 (i.e.
it still works with $SAFE = 1 and $SAFE = 2).

I am perplexed :(

D'oh! Apologies for replying to myself, but I've realised what the
problem was. Stupidly I'd neglected to chmod 755 .../client/ :(

Cheers,

Richard.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top