Errors with a Ruby CGI script

Okay, so I got Ruby installed on that Solaris 8 machine and everything
seems okay. As me I can do:

(05:30PM) [kdresner@sanjacinto /p/lib/ruby/1.8]$ irb
irb(main):001:0> require ‘net/smtp’
=> true
irb(main):002:0>

However, in my CGI script, which is run as the user “www”, this
operation results in a LoadError: more specifically:

[Sun Aug 31 17:27:56 2003] [error] [client 66.25.137.71] Premature end
of script headers: gradechange.cgi
[Sun Aug 31 17:27:56 2003] [error] [client 66.25.137.71]
/p/lib/ruby/1.8/net/smtp.rb:325:in require': No such file to load -- digest/md5 (LoadError) [Sun Aug 31 17:27:56 2003] [error] [client 66.25.137.71] from /p/lib/ruby/1.8/net/smtp.rb:325 [Sun Aug 31 17:27:56 2003] [error] [client 66.25.137.71] from /var/spool/net/vhosts/cs_utexas_edu/www/users/kdresner/gradechange.cgi:8:inrequire’
[Sun Aug 31 17:27:56 2003] [error] [client 66.25.137.71] from
/var/spool/net/vhosts/cs_utexas_edu/www/users/kdresner/gradechange.cgi:8

So it seems that smtp.rb is having a hard time loading digest/md5.
Here’s the deal, digest/md5 is in the directory:

/p/lib/ruby/1.8/sparc-solaris2.8/digest/md5.so

Is there any reason that it would look in that directory as a normal
user, but not as the www user?

-Kurt

So it seems that smtp.rb is having a hard time loading digest/md5.
Here’s the deal, digest/md5 is in the directory:

/p/lib/ruby/1.8/sparc-solaris2.8/digest/md5.so

Is there any reason that it would look in that directory as a normal
user, but not as the www user?

Odd. Can you su to ‘www’ and run ruby -e 'require "digest/md5"' ?
Does it give the same error?

···


Daniel Carrera, Math PhD student at UMD. PGP KeyID: 9AF77A88
.-“~~~”-.
/ O O \ ATTENTION ALL PASCAL USERS:
: s :
\ _/ / To commemorate the anniversary of Blaise Pascal’s
`-.
_.-’ birth (today) all your programs will run at half speed.

I can’t. I’m not root. However, I can go into smtp.rb and comment out
the line that says “require ‘digest/md5’”

I did this, and now my script works fine, however, will this be
detrimental to anyone else?

-Kurt

···

On Mon, Sep 01, 2003 at 07:57:31AM +0900, Daniel Carrera wrote:

So it seems that smtp.rb is having a hard time loading digest/md5.
Here’s the deal, digest/md5 is in the directory:

/p/lib/ruby/1.8/sparc-solaris2.8/digest/md5.so

Is there any reason that it would look in that directory as a normal
user, but not as the www user?

Odd. Can you su to ‘www’ and run ruby -e 'require "digest/md5"' ?
Does it give the same error?


Daniel Carrera, Math PhD student at UMD. PGP KeyID: 9AF77A88
.-“~~~”-.
/ O O \ ATTENTION ALL PASCAL USERS:
: s :
\ _/ / To commemorate the anniversary of Blaise Pascal’s
`-.
_.-’ birth (today) all your programs will run at half speed.

======= End of Original Message =======<

Okay, I found the problem. Turns out that Sun’s chmod sucks a fat one.

Had to mess with some stick-bits.

Ick.

-Kurt

···

On Mon, Sep 01, 2003 at 07:59:04AM +0900, Kurt M. Dresner wrote:

I can’t. I’m not root. However, I can go into smtp.rb and comment out
the line that says “require ‘digest/md5’”

I did this, and now my script works fine, however, will this be
detrimental to anyone else?

-Kurt

On Mon, Sep 01, 2003 at 07:57:31AM +0900, Daniel Carrera wrote:

So it seems that smtp.rb is having a hard time loading digest/md5.
Here’s the deal, digest/md5 is in the directory:

/p/lib/ruby/1.8/sparc-solaris2.8/digest/md5.so

Is there any reason that it would look in that directory as a normal
user, but not as the www user?

Odd. Can you su to ‘www’ and run ruby -e 'require "digest/md5"' ?
Does it give the same error?


Daniel Carrera, Math PhD student at UMD. PGP KeyID: 9AF77A88
.-“~~~”-.
/ O O \ ATTENTION ALL PASCAL USERS:
: s :
\ _/ / To commemorate the anniversary of Blaise Pascal’s
`-.
_.-’ birth (today) all your programs will run at half speed.

======= End of Original Message =======<

======= End of Original Message =======<

Oh, I see.
Check the permissions on digest/md5.so. Perhaps it’s not readable by
“other” (though it should be).

As for whether it’ll be detrimental to comment out “require ‘digest/md5’”,
I honestly don’t know. I’m sure the line is there for a reason, so “weird
things” might happen when it’s commented out. It’d be better if someone
more familiar with Ruby’s CGI could tell us exactly what features actually
use MD5.

Daniel.

···

On Mon, Sep 01, 2003 at 07:59:04AM +0900, Kurt M. Dresner wrote:

I can’t. I’m not root. However, I can go into smtp.rb and comment out
the line that says “require ‘digest/md5’”

I did this, and now my script works fine, however, will this be
detrimental to anyone else?

-Kurt

On Mon, Sep 01, 2003 at 07:57:31AM +0900, Daniel Carrera wrote:

So it seems that smtp.rb is having a hard time loading digest/md5.
Here’s the deal, digest/md5 is in the directory:

/p/lib/ruby/1.8/sparc-solaris2.8/digest/md5.so

Is there any reason that it would look in that directory as a normal
user, but not as the www user?

Odd. Can you su to ‘www’ and run ruby -e 'require "digest/md5"' ?
Does it give the same error?


Daniel Carrera, Math PhD student at UMD. PGP KeyID: 9AF77A88
.-“~~~”-.
/ O O \ ATTENTION ALL PASCAL USERS:
: s :
\ _/ / To commemorate the anniversary of Blaise Pascal’s
`-.
_.-’ birth (today) all your programs will run at half speed.

======= End of Original Message =======<


Daniel Carrera, Math PhD student at UMD. PGP KeyID: 9AF77A88
.-“~~~”-.
/ O O \ ATTENTION ALL PASCAL USERS:
: s :
\ _/ / To commemorate the anniversary of Blaise Pascal’s
`-.
_.-’ birth (today) all your programs will run at half speed.

Yup. I’ve had my share of Solaris annoyances myself. I miss my Linux
box.

I’m glad the problem got solved.

···

On Mon, Sep 01, 2003 at 08:05:13AM +0900, Kurt M. Dresner wrote:

Okay, I found the problem. Turns out that Sun’s chmod sucks a fat one.

Had to mess with some stick-bits.

Ick.


Daniel Carrera, Math PhD student at UMD. PGP KeyID: 9AF77A88
.-“~~~”-.
/ O O \ ATTENTION ALL PASCAL USERS:
: s :
\ _/ / To commemorate the anniversary of Blaise Pascal’s
`-.
_.-’ birth (today) all your programs will run at half speed.