Class DBus::Client
In: lib/dbus/auth.rb
Parent: Object

Authentication client class.

Class tha performs the actional authentication.

Methods

authenticate   new  

Public Class methods

Create a new authentication client.

[Source]

# File lib/dbus/auth.rb, line 115
    def initialize(socket)
      @socket = socket
      @state = nil
      @auth_list = [External,DBusCookieSHA1]
    end

Public Instance methods

Start the authentication process.

[Source]

# File lib/dbus/auth.rb, line 122
    def authenticate
      if (RbConfig::CONFIG["target_os"] =~ /bsd/)
        @socket.sendmsg(0.chr, 0, nil, [:SOCKET, :SCM_CREDS, ""])
      else
        @socket.write(0.chr)
      end
      next_authenticator
      @state = :Starting
      while @state != :Authenticated
        r = next_state
        return r if not r
      end
      true
    end

[Validate]