Class: Gio::Credentials

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Overview

Class structure for #GCredentials.

Instance Method Summary collapse

Instance Method Details

#get_native(native_type) ⇒ GObject

Gets a pointer to native credentials of type native_type from credentials.

It is a programming error (which will cause a warning to be logged) to use this method if there is no #GCredentials support for the OS or if native_type isn’t supported by the OS. operation there is no #GCredentials support for the OS or if native_type isn’t supported by the OS. Do not free the returned data, it is owned by credentials.

Parameters:

Returns:

  • (GObject)

    The pointer to native credentials or nil if the

#is_same_user(other_credentials) ⇒ TrueClass

Checks if credentials and other_credentials is the same user.

This operation can fail if #GCredentials is not supported on the the OS. user, false otherwise or if error is set.

Parameters:

Returns:

  • (TrueClass)

    true if credentials and other_credentials has the same

#newGio::Credentials

Creates a new #GCredentials object with credentials matching the the current process.

Returns:

#set_native(native_type, native) ⇒ nil

Copies the native credentials of type native_type from native into credentials.

It is a programming error (which will cause a warning to be logged) to use this method if there is no #GCredentials support for the OS or if native_type isn’t supported by the OS.

Parameters:

  • native_type (Gio::CredentialsType)

    The type of native credentials to set.

  • native (GObject)

    A pointer to native credentials.

Returns:

  • (nil)

#to_stringString

Creates a human-readable textual representation of credentials that can be used in logging and debug messages. The format of the returned string may change in future GLib release.

Returns:

  • (String)

    A string that should be freed with g_free().

#unix_pidInteger

Tries to get the UNIX process identifier from credentials. This method is only available on UNIX platforms.

This operation can fail if #GCredentials is not supported on the OS or if the native credentials type does not contain information about the UNIX process ID.

Returns:

  • (Integer)

    The UNIX process ID, or -1 if error is set.

#unix_userInteger

Tries to get the UNIX user identifier from credentials. This method is only available on UNIX platforms.

This operation can fail if #GCredentials is not supported on the OS or if the native credentials type does not contain information about the UNIX user.

Returns:

  • (Integer)

    The UNIX user identifier or -1 if error is set.

#unix_user=(uid) ⇒ TrueClass

Tries to set the UNIX user identifier on credentials. This method is only available on UNIX platforms.

This operation can fail if #GCredentials is not supported on the OS or if the native credentials type does not contain information about the UNIX user. It can also fail if the OS does not allow the use of “spoofed” credentials.

Parameters:

  • uid (Integer)

    The UNIX user identifier to set.

Returns:

  • (TrueClass)

    true if uid was set, false if error is set.