class DBus::External
External
authentication class¶ ↑
Class
for ‘external’ type authentication.
Public Instance Methods
authenticate()
click to toggle source
Performs the authentication.
# File lib/dbus/auth.rb 36 def authenticate 37 # Take the user id (eg integer 1000) make a string out of it "1000", take 38 # each character and determin hex value "1" => 0x31, "0" => 0x30. You 39 # obtain for "1000" => 31303030 This is what the server is expecting. 40 # Why? I dunno. How did I come to that conclusion? by looking at rbus 41 # code. I have no idea how he found that out. 42 Process.uid.to_s.split(//).map { |d| d.ord.to_s(16) }.join 43 end