GUnixCredentialsMessage

GUnixCredentialsMessage — A GSocketControlMessage containing credentials

Synopsis

#include <gio/gunixcredentialsmessage.h>

                    GUnixCredentialsMessage;
struct              GUnixCredentialsMessageClass;
GSocketControlMessage * g_unix_credentials_message_new  (void);
GSocketControlMessage * g_unix_credentials_message_new_with_credentials
                                                        (GCredentials *credentials);
GCredentials *      g_unix_credentials_message_get_credentials
                                                        (GUnixCredentialsMessage *message);
gboolean            g_unix_credentials_message_is_supported
                                                        (void);

Object Hierarchy

  GObject
   +----GSocketControlMessage
         +----GUnixCredentialsMessage

Properties

  "credentials"              GCredentials*         : Read / Write / Construct Only

Description

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().

Details

GUnixCredentialsMessage

typedef struct _GUnixCredentialsMessage GUnixCredentialsMessage;

The GUnixCredentialsMessage structure contains only private data and should only be accessed using the provided API.

Since 2.26


struct GUnixCredentialsMessageClass

struct GUnixCredentialsMessageClass {
  GSocketControlMessageClass parent_class;
};

Class structure for GUnixCredentialsMessage.

Since 2.26


g_unix_credentials_message_new ()

GSocketControlMessage * g_unix_credentials_message_new  (void);

Creates a new GUnixCredentialsMessage with credentials matching the current processes.

Returns :

a new GUnixCredentialsMessage

Since 2.26


g_unix_credentials_message_new_with_credentials ()

GSocketControlMessage * g_unix_credentials_message_new_with_credentials
                                                        (GCredentials *credentials);

Creates a new GUnixCredentialsMessage holding credentials.

credentials :

A GCredentials object.

Returns :

a new GUnixCredentialsMessage

Since 2.26


g_unix_credentials_message_get_credentials ()

GCredentials *      g_unix_credentials_message_get_credentials
                                                        (GUnixCredentialsMessage *message);

Gets the credentials stored in message.

message :

A GUnixCredentialsMessage.

Returns :

A GCredentials instance. Do not free, it is owned by message. [transfer none]

Since 2.26


g_unix_credentials_message_is_supported ()

gboolean            g_unix_credentials_message_is_supported
                                                        (void);

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

Returns :

TRUE if supported, FALSE otherwise

Since 2.26

Property Details

The "credentials" property

  "credentials"              GCredentials*         : Read / Write / Construct Only

The credentials stored in the message.

Since 2.26

See Also

GUnixConnection, GSocketControlMessage