JRuby

Process.euid() not implemented, causes MailFactory failure

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.0.0RC2
  • Fix Version/s: JRuby 1.1RC2
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows XP, with and without NetBeans
  • Number of attachments :
    0

Description

Running JRuby in NetBeans:
-------------------------
require 'rubygems'
require 'mailfactory'
mail = MailFactory.new()
mail.to = 'to address'
mail.from = 'from address'
mail.subject = 'subject'
mail.text = 'message'
puts mail.to_s
--returns nil

Running JIRB:
------------
jirb> require 'rubygems'
jirb> require 'mailfactory'
jirb> mail = MailFactory.new()
jirb> mail.to_s
NoMethodError: undefined or inaccessible method `euid' for
Process:Module
from
C:/jruby-1.0.0RC2/lib/ruby/gems/1.8/gems/mailfactory-1.2.3/lib/mail
factory.rb:181:in `method_missing'
from
C:/jruby-1.0.0RC2/lib/ruby/gems/1.8/gems/mailfactory-1.2.3/lib/mail
factory.rb:181:in `construct'
from
C:/jruby-1.0.0RC2/lib/ruby/gems/1.8/gems/mailfactory-1.2.3/lib/mail
factory.rb:211:in `to_s'
from (irb):1:in `binding'
irb(main):011:0>

Although reported on line 181, the error appears to stem
from line 182 of factory.rb:

add_header("Message-ID",
"<#{Time.now.to_f()}.#{Process.euid()}.#{String.new.object_id()}@#{sendingdomain}>")
^^^^^^^^^^^^^^
According to the API docs:
Process.euid => fixnum
Returns the effective user ID for this process.
Process.euid #=> 501

Activity

Hide
Charles Oliver Nutter added a comment -

We could fix this with JNA in 1.1 and probably provide a similar bogus value to uid in 1.0.

Show
Charles Oliver Nutter added a comment - We could fix this with JNA in 1.1 and probably provide a similar bogus value to uid in 1.0.
Hide
Thomas E Enebo added a comment -

I have been adding a whole bunch of methods for Process for trunk, but I am not sure what we should do for 1.0.x? Bogus values for things like uid really depend on what they are using uid for. I would hate to have a script chown to a privileged user (totally made up example) because we returned a bad value (like 0).

Show
Thomas E Enebo added a comment - I have been adding a whole bunch of methods for Process for trunk, but I am not sure what we should do for 1.0.x? Bogus values for things like uid really depend on what they are using uid for. I would hate to have a script chown to a privileged user (totally made up example) because we returned a bad value (like 0).
Hide
Charles Oliver Nutter added a comment -

Yeah, I'm not sure. I agree that bogus values could be dangerous, but the only way to get non-bogus values is through something like JNA. That would be too big an addition to 1.0 branch IMHO. I think perhaps it would be best for us to just recommend people upgrade to 1.1 if they need those methods to work correctly.

Show
Charles Oliver Nutter added a comment - Yeah, I'm not sure. I agree that bogus values could be dangerous, but the only way to get non-bogus values is through something like JNA. That would be too big an addition to 1.0 branch IMHO. I think perhaps it would be best for us to just recommend people upgrade to 1.1 if they need those methods to work correctly.
Hide
Charles Oliver Nutter added a comment -

So where do we stand on this Tom? Made a decision for 1.0.2?

Show
Charles Oliver Nutter added a comment - So where do we stand on this Tom? Made a decision for 1.0.2?
Hide
Thomas E Enebo added a comment -

I think we have to bump for this for 1.0.2. I will still land the 1.1 version that uses JNA (along with the other methods I added at the same time). I bumped to 1.0.3. 1.1 stuff coming...

Show
Thomas E Enebo added a comment - I think we have to bump for this for 1.0.2. I will still land the 1.1 version that uses JNA (along with the other methods I added at the same time). I bumped to 1.0.3. 1.1 stuff coming...
Hide
Charles Oliver Nutter added a comment -

Tom...will this land for 1.1b1? Move back to 1.1b1 and go for it if so.

Show
Charles Oliver Nutter added a comment - Tom...will this land for 1.1b1? Move back to 1.1b1 and go for it if so.
Hide
Thomas E Enebo added a comment -

Fixed in commit 4867 on trunk. This cannot be implemented on 1.0.3 in any meaningful way without JNA. So WONTFIX on 1.0 branch. We will encourage 1.1 upgrade for users who need this.

Show
Thomas E Enebo added a comment - Fixed in commit 4867 on trunk. This cannot be implemented on 1.0.3 in any meaningful way without JNA. So WONTFIX on 1.0 branch. We will encourage 1.1 upgrade for users who need this.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: