Issue Details (XML | Word | Printable)

Key: JRUBY-1106
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Thomas E Enebo
Reporter: Eric Armstrong
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JRuby

Process.euid() not implemented, causes MailFactory failure

Created: 04/Jun/07 05:45 PM   Updated: 23/Apr/08 10:02 AM
Component/s: None
Affects Version/s: JRuby 1.0.0RC2
Fix Version/s: JRuby 1.1RC2

Time Tracking:
Not Specified

Environment: Windows XP, with and without NetBeans


 Description  « Hide
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



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Charles Oliver Nutter added a comment - 23/Oct/07 12:47 PM
We could fix this with JNA in 1.1 and probably provide a similar bogus value to uid in 1.0.

Thomas E Enebo added a comment - 28/Oct/07 04:36 PM
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).

Charles Oliver Nutter added a comment - 29/Oct/07 07:29 PM
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.

Charles Oliver Nutter added a comment - 30/Oct/07 02:11 AM
So where do we stand on this Tom? Made a decision for 1.0.2?

Thomas E Enebo added a comment - 30/Oct/07 10:20 AM
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...

Charles Oliver Nutter added a comment - 30/Oct/07 10:12 PM
Tom...will this land for 1.1b1? Move back to 1.1b1 and go for it if so.

Thomas E Enebo added a comment - 06/Nov/07 05:27 PM
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.