Class

GioUnixCredentialsMessage

since: 2.26

Description

class Gio.UnixCredentialsMessage : Gio.SocketControlMessage {
  parent_instance: GSocketControlMessage,
  priv: GUnixCredentialsMessagePrivate*
}

This GSocketControlMessage contains a GCredentials instance. It may be sent using g_socket_send_message() and received using g_socket_receive_message() over UNIX sockets (ie: sockets in the G_SOCKET_FAMILY_UNIX family).

For an easier way to send and receive credentials over stream-oriented UNIX sockets, see g_unix_connection_send_credentials() and g_unix_connection_receive_credentials(). To receive credentials of a foreign process connected to a socket, use g_socket_get_credentials().

Since GLib 2.72, GUnixCredentialMessage is available on all platforms. It requires underlying system support (such as Windows 10 with AF_UNIX) at run time.

Before GLib 2.72, <gio/gunixcredentialsmessage.h> belonged to the UNIX-specific GIO interfaces, thus you had to use the gio-unix-2.0.pc pkg-config file when using it. This is no longer necessary since GLib 2.72.

Available since: 2.26

Hierarchy

hierarchy this GUnixCredentialsMessage ancestor_0 GSocketControlMessage ancestor_0--this ancestor_1 GObject ancestor_1--ancestor_0

Constructors

g_unix_credentials_message_new

Creates a new GUnixCredentialsMessage with credentials matching the current processes.

since: 2.26

g_unix_credentials_message_new_with_credentials

Creates a new GUnixCredentialsMessage holding credentials.

since: 2.26

Functions

g_unix_credentials_message_is_supported

Checks if passing GCredentials on a GSocket is supported on this platform.

since: 2.26

Instance methods

g_unix_credentials_message_get_credentials

Gets the credentials stored in message.

since: 2.26

Methods inherited from GSocketControlMessage (4)
g_socket_control_message_get_level

Returns the “level” (i.e. the originating protocol) of the control message. This is often SOL_SOCKET.

since: 2.22

g_socket_control_message_get_msg_type

Returns the protocol specific type of the control message. For instance, for UNIX fd passing this would be SCM_RIGHTS.

since: 2.22

g_socket_control_message_get_size

Returns the space required for the control message, not including headers or alignment.

since: 2.22

g_socket_control_message_serialize

Converts the data in the message to bytes placed in the message.

since: 2.22

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

Gio.UnixCredentialsMessage:credentials

The credentials stored in the message.

since: 2.26

Signals

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct GioUnixCredentialsMessageClass {
  GSocketControlMessageClass parent_class;
  void (* _g_reserved1) (
void
  );
  void (* _g_reserved2) (
void
  );
  
}

Class structure for GUnixCredentialsMessage.

Class members
parent_class: GSocketControlMessageClass
No description available.
_g_reserved1: void (* _g_reserved1) ( void )
No description available.
_g_reserved2: void (* _g_reserved2) ( void )
No description available.