1.100 <GUnixCredentialsMessage>

Class: <GUnixCredentialsMessage>

It derives from <GSocketControlMessage>.

This <GSocketControlMessage> contains a <GCredentials> instance. It may be sent using Gio.Socket.send_message and received using Gio.Socket.receive_message over UNIX sockets (ie: sockets in the unix family).

For an easier way to send and receive credentials over stream-oriented UNIX sockets, see unix-connection:send-credentials? and unix-connection:receive-credentials. To receive credentials of a foreign process connected to a socket, use 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.

Fields

parent-instance
priv

Properties

Property: unix-credentials-message:credentials self

The credentials stored in the message.

Its value is a <GCredentials>, or #f.

It can only be set when the object is made, with #:credentials.

Procedures

Method: unix-credentials-message:get-credentials self ⇒ %return
Method: get-credentials self ⇒ %return

Gets the credentials stored in self.

self

Passed: a <GUnixCredentialsMessage>.

A <GUnixCredentialsMessage>.

%return

Returned: a <GCredentials>.

A <GCredentials> instance. Do not free, it is owned by self.

Procedure: unix-credentials-message:is-supported? ⇒ %return

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

%return

Returned: a boolean.

#t if supported, #f otherwise

Procedure: unix-credentials-message:new ⇒ %return

Creates a new <GUnixCredentialsMessage> with credentials matching the current processes.

%return

Returned: a <GSocketControlMessage>.

a new <GUnixCredentialsMessage>

Procedure: unix-credentials-message:new-with-credentials credentials ⇒ %return

Creates a new <GUnixCredentialsMessage> holding credentials.

credentials

Passed: a <GCredentials>.

A <GCredentials> object.

%return

Returned: a <GSocketControlMessage>.

a new <GUnixCredentialsMessage>