25 #include "dbus-transport-protected.h" 
   26 #include "dbus-transport-unix.h" 
   27 #include "dbus-transport-socket.h" 
   28 #include "dbus-connection-internal.h" 
   29 #include "dbus-watch.h" 
   30 #include "dbus-auth.h" 
   31 #include "dbus-address.h" 
   32 #include "dbus-credentials.h" 
   33 #include "dbus-mainloop.h" 
   34 #include "dbus-message.h" 
   35 #ifdef DBUS_ENABLE_EMBEDDED_TESTS 
   36 #include "dbus-server-debug-pipe.h" 
   70   _dbus_verbose (
"Size counter value is now %d\n",
 
   72   _dbus_verbose (
"Unix FD counter value is now %d\n",
 
  164   transport->
vtable = vtable;
 
  165   transport->
loader = loader;
 
  166   transport->
auth = auth;
 
  173   transport->
address = address_copy;
 
  200                             live_messages_notify,
 
  204     _dbus_verbose (
"Initialized transport on address %s\n", transport->
address);
 
  250 check_address (
const char *address, 
DBusError *error)
 
  257   _DBUS_ASSERT_ERROR_IS_CLEAR (error);
 
  262   for (i = 0; i < len; i++)
 
  267       if (transport != 
NULL)
 
  284 _dbus_transport_new_for_autolaunch (
const char *scope, 
DBusError *error)
 
  289   _DBUS_ASSERT_ERROR_IS_CLEAR (error);
 
  299       _DBUS_ASSERT_ERROR_IS_SET (error);
 
  303   result = check_address (_dbus_string_get_const_data (&address), error);
 
  305     _DBUS_ASSERT_ERROR_IS_SET (error);
 
  307     _DBUS_ASSERT_ERROR_IS_CLEAR (error);
 
  314 static DBusTransportOpenResult
 
  324   if (strcmp (method, 
"autolaunch") == 0)
 
  328       *transport_p = _dbus_transport_new_for_autolaunch (scope, error);
 
  330       if (*transport_p == 
NULL)
 
  332           _DBUS_ASSERT_ERROR_IS_SET (error);
 
  333           return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
 
  337           _DBUS_ASSERT_ERROR_IS_CLEAR (error);
 
  338           return DBUS_TRANSPORT_OPEN_OK;
 
  343       _DBUS_ASSERT_ERROR_IS_CLEAR (error);
 
  344       return DBUS_TRANSPORT_OPEN_NOT_HANDLED;
 
  348 static const struct {
 
  355   { _dbus_transport_open_autolaunch }
 
  356 #ifdef DBUS_ENABLE_EMBEDDED_TESTS 
  357   , { _dbus_transport_open_debug_pipe }
 
  374   const char *expected_guid_orig;
 
  379   _DBUS_ASSERT_ERROR_IS_CLEAR (error);
 
  385   if (expected_guid_orig != 
NULL && expected_guid == 
NULL)
 
  387       _DBUS_SET_OOM (error);
 
  393       DBusTransportOpenResult result;
 
  395       _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
 
  396       result = (* open_funcs[i].func) (entry, &transport, &tmp_error);
 
  400         case DBUS_TRANSPORT_OPEN_OK:
 
  401           _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
 
  404         case DBUS_TRANSPORT_OPEN_NOT_HANDLED:
 
  405           _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
 
  408         case DBUS_TRANSPORT_OPEN_BAD_ADDRESS:
 
  409           _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
 
  412         case DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT:
 
  413           _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
 
  424   if (transport == 
NULL)
 
  429                                "Unknown address type (examples of valid types are \"tcp\" and on UNIX \"unix\")");
 
  431       _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
 
  437       _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
 
  491       _dbus_verbose (
"finalizing\n");
 
  510   _dbus_verbose (
"start\n");
 
  521   _dbus_verbose (
"end\n");
 
  545   void *unix_user_data;
 
  558   _dbus_verbose (
"unlock\n");
 
  561   allow = (* unix_user_function) (connection,
 
  565   _dbus_verbose (
"lock post unix user function\n");
 
  575                      " was rejected, disconnecting\n",
 
  590   void *windows_user_data;
 
  603   if (windows_sid == 
NULL)
 
  609   _dbus_verbose (
"unlock\n");
 
  612   allow = (* windows_user_function) (connection,
 
  616   _dbus_verbose (
"lock post windows user function\n");
 
  621       _dbus_verbose (
"Client SID '%s' authorized\n", windows_sid);
 
  625       _dbus_verbose (
"Client SID '%s' was rejected, disconnecting\n",
 
  648   if (our_identity == 
NULL)
 
  660           _dbus_verbose (
"Client authorized as SID '%s'" 
  661                          "matching our SID '%s'\n",
 
  675           _dbus_verbose (
"Client authorized as SID '%s'" 
  676                          " but our SID is '%s', disconnecting\n",
 
  744       maybe_authenticated =
 
  748       if (maybe_authenticated)
 
  752             case DBUS_AUTH_STATE_AUTHENTICATED:
 
  756             case DBUS_AUTH_STATE_WAITING_FOR_INPUT:
 
  757             case DBUS_AUTH_STATE_WAITING_FOR_MEMORY:
 
  758             case DBUS_AUTH_STATE_HAVE_BYTES_TO_SEND:
 
  759             case DBUS_AUTH_STATE_NEED_DISCONNECT:
 
  760               maybe_authenticated = 
FALSE;
 
  763             case DBUS_AUTH_STATE_INVALID:
 
  771       if (maybe_authenticated && !transport->
is_server)
 
  773           const char *server_guid;
 
  781               _dbus_verbose (
"Client expected GUID '%s' and we got '%s' from the server\n",
 
  791       if (maybe_authenticated && transport->
is_server)
 
  806               allow = auth_via_unix_user_function (transport);
 
  811               allow = auth_via_windows_user_function (transport);
 
  815               allow = auth_via_default_rules (transport);
 
  819             maybe_authenticated = 
FALSE;
 
  825       return maybe_authenticated;
 
  860   return DBUS_TRANSPORT_CAN_SEND_UNIX_FD(transport);
 
  906                               unsigned int             condition)
 
 1001                               int             timeout_milliseconds)
 
 1005   _dbus_verbose (
"Transport iteration flags 0x%x timeout %d connected = %d\n",
 
 1006                  flags, timeout_milliseconds, !transport->
disconnected);
 
 1008   if ((flags & (DBUS_ITERATION_DO_WRITING |
 
 1009                 DBUS_ITERATION_DO_READING)) == 0)
 
 1017                                        timeout_milliseconds);
 
 1020   _dbus_verbose (
"end\n");
 
 1040                                    encoded, &plaintext))
 
 1051       orig_len = _dbus_string_get_length (buffer);
 
 1060       _dbus_verbose (
" %d unused bytes sent to message loader\n", 
 
 1061                      _dbus_string_get_length (buffer) -
 
 1075 #ifdef DBUS_ENABLE_VERBOSE_MODE 
 1085 #ifdef DBUS_ENABLE_VERBOSE_MODE 
 1086       orig_len = _dbus_string_get_length (buffer);
 
 1096       _dbus_verbose (
" %d unused bytes sent to message loader\n", 
 
 1097                      _dbus_string_get_length (buffer) -
 
 1112   _dbus_verbose (
"Not enough memory to transfer unused bytes from auth conversation\n");
 
 1133           DBUS_AUTH_STATE_WAITING_FOR_MEMORY)
 
 1140       !recover_unused_bytes (transport))
 
 1168   _dbus_verbose (
"enter\n");
 
 1180       message = link->
data;
 
 1182       _dbus_verbose (
"queueing received message %p\n", message);
 
 1208       _dbus_verbose (
"Corrupted message stream, disconnecting\n");
 
 1279                             live_messages_notify,
 
 1297                             live_messages_notify,
 
 1349                                  DBUS_CREDENTIAL_UNIX_USER_ID))
 
 1382                                  DBUS_CREDENTIAL_UNIX_PROCESS_ID))
 
 1415                                  DBUS_CREDENTIAL_ADT_AUDIT_DATA_ID))
 
 1452 _dbus_transport_get_linux_security_label (
DBusTransport  *transport,
 
 1465                                  DBUS_CREDENTIAL_LINUX_SECURITY_LABEL))
 
 1487                                   char                      **windows_sid_p)
 
 1491   *windows_sid_p = 
NULL;
 
 1499                                  DBUS_CREDENTIAL_WINDOWS_SID))
 
 1547                                      const char    **mechanisms)
 
 1585                                            void (* callback) (
void *),
 
 1592 #ifdef DBUS_ENABLE_STATS 
 1600   if (queue_bytes != 
NULL)
 
 1603   if (queue_fds != 
NULL)
 
 1606   if (peak_queue_bytes != 
NULL)
 
 1607     *peak_queue_bytes = _dbus_counter_get_peak_size_value (transport->
live_messages);
 
 1609   if (peak_queue_fds != 
NULL)
 
 1610     *peak_queue_fds = _dbus_counter_get_peak_unix_fd_value (transport->
live_messages);
 
  
#define _DBUS_N_ELEMENTS(array)
long _dbus_transport_get_max_received_unix_fds(DBusTransport *transport)
See dbus_connection_set_max_received_unix_fds().
const DBusTransportVTable * vtable
Virtual methods for this instance.
dbus_bool_t _dbus_transport_get_is_connected(DBusTransport *transport)
Returns TRUE if the transport has not been disconnected.
void _dbus_transport_set_allow_anonymous(DBusTransport *transport, dbus_bool_t value)
See dbus_connection_set_allow_anonymous()
int refcount
Reference count.
DBusTransportOpenResult _dbus_transport_open_platform_specific(DBusAddressEntry *entry, DBusTransport **transport_p, DBusError *error)
Opens platform specific transport types.
DBusMessageLoader * loader
Message-loading buffer.
DBusDispatchStatus
Indicates the status of incoming data on a DBusConnection.
void _dbus_message_loader_set_max_message_unix_fds(DBusMessageLoader *loader, long n)
Sets the maximum unix fds per message we allow.
void _dbus_string_free(DBusString *str)
Frees a string created by _dbus_string_init().
DBusTransport * _dbus_transport_ref(DBusTransport *transport)
Increments the reference count for the transport.
char * address
Address of the server we are connecting to (NULL for the server side of a transport)
dbus_bool_t _dbus_transport_try_to_authenticate(DBusTransport *transport)
Returns TRUE if we have been authenticated.
void(* live_messages_changed)(DBusTransport *transport)
Outstanding messages counter changed.
void _dbus_transport_do_iteration(DBusTransport *transport, unsigned int flags, int timeout_milliseconds)
Performs a single poll()/select() on the transport's file descriptors and then reads/writes data as a...
DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_message_loader_queue_messages(DBusMessageLoader *loader)
Converts buffered data into messages, if we have enough data.
int _dbus_message_loader_get_pending_fds_count(DBusMessageLoader *loader)
Return how many file descriptors are pending in the loader.
DBusAuthState _dbus_auth_do_work(DBusAuth *auth)
Analyzes buffered input and moves the auth conversation forward, returning the new state of the auth ...
const char * _dbus_credentials_get_windows_sid(DBusCredentials *credentials)
Gets the Windows user SID in the credentials, or NULL if the credentials object doesn't contain a Win...
dbus_bool_t _dbus_get_autolaunch_address(const char *scope, DBusString *address, DBusError *error)
Returns the address of a new session bus.
DBusCounter * _dbus_counter_new(void)
Creates a new DBusCounter.
dbus_bool_t _dbus_auth_needs_decoding(DBusAuth *auth)
Called post-authentication, indicates whether we need to decode the message stream with _dbus_auth_de...
dbus_bool_t _dbus_message_add_counter(DBusMessage *message, DBusCounter *counter)
Adds a counter to be incremented immediately with the size/unix fds of this message,...
void _dbus_transport_disconnect(DBusTransport *transport)
Closes our end of the connection to a remote application.
@ DBUS_DISPATCH_COMPLETE
All currently available data has been processed.
#define DBUS_UID_FORMAT
an appropriate printf format for dbus_uid_t
void(* DBusFreeFunction)(void *memory)
void _dbus_transport_set_max_message_size(DBusTransport *transport, long size)
See dbus_connection_set_max_message_size().
dbus_bool_t _dbus_credentials_same_user(DBusCredentials *credentials, DBusCredentials *other_credentials)
Check whether the user-identifying credentials in two credentials objects are identical.
void _dbus_counter_unref(DBusCounter *counter)
Decrements refcount of the counter and possibly finalizes the counter.
void _dbus_watch_sanitize_condition(DBusWatch *watch, unsigned int *condition)
Sanitizes the given condition so that it only contains flags that the DBusWatch requested.
void * _dbus_credentials_get_adt_audit_data(DBusCredentials *credentials)
Gets the ADT audit data in the credentials, or NULL if the credentials object doesn't contain ADT aud...
Implementation of DBusWatch.
dbus_bool_t _dbus_string_copy(const DBusString *source, int start, DBusString *dest, int insert_at)
Like _dbus_string_move(), but does not delete the section of the source string that's copied to the d...
DBUS_PRIVATE_EXPORT void _dbus_connection_lock(DBusConnection *connection)
Acquires the connection lock.
void _dbus_message_loader_putback_message_link(DBusMessageLoader *loader, DBusList *link)
Returns a popped message link, used to undo a pop.
void dbus_address_entries_free(DBusAddressEntry **entries)
Frees a NULL-terminated array of address entries.
const char * dbus_address_entry_get_method(DBusAddressEntry *entry)
Returns the method string of an address entry.
unsigned int is_server
TRUE if on the server side
dbus_bool_t(* handle_watch)(DBusTransport *transport, DBusWatch *watch, unsigned int flags)
The handle_watch method handles reading/writing data as indicated by the flags.
dbus_bool_t _dbus_string_copy_data(const DBusString *str, char **data_return)
Copies the data from the string into a char*.
void _dbus_message_loader_set_max_message_size(DBusMessageLoader *loader, long size)
Sets the maximum size message we allow.
Implementation details of DBusConnection.
void _dbus_message_loader_set_pending_fds_function(DBusMessageLoader *loader, void(*callback)(void *), void *data)
Register a function to be called whenever the number of pending file descriptors in the loader change...
dbus_bool_t _dbus_string_init(DBusString *str)
Initializes a string.
void _dbus_transport_set_max_received_unix_fds(DBusTransport *transport, long n)
See dbus_connection_set_max_received_unix_fds().
dbus_bool_t _dbus_auth_set_mechanisms(DBusAuth *auth, const char **mechanisms)
Sets an array of authentication mechanism names that we are willing to use.
DBUS_PRIVATE_EXPORT long _dbus_message_loader_get_max_message_size(DBusMessageLoader *loader)
Gets the maximum allowed message size in bytes.
dbus_bool_t _dbus_auth_decode_data(DBusAuth *auth, const DBusString *encoded, DBusString *plaintext)
Called post-authentication, decodes a block of bytes received from the peer.
dbus_bool_t(* get_socket_fd)(DBusTransport *transport, DBusSocket *fd_p)
Get socket file descriptor.
DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_message_loader_get_is_corrupted(DBusMessageLoader *loader)
Checks whether the loader is confused due to bad data.
void(* do_iteration)(DBusTransport *transport, unsigned int flags, int timeout_milliseconds)
Called to do a single "iteration" (block on select/poll followed by reading or writing data).
void _dbus_watch_unref(DBusWatch *watch)
Decrements the reference count of a DBusWatch object and finalizes the object if the count reaches ze...
char * expected_guid
GUID we expect the server to have, NULL on server side or if we don't have an expectation.
dbus_uid_t _dbus_credentials_get_unix_uid(DBusCredentials *credentials)
Gets the UNIX user ID in the credentials, or DBUS_UID_UNSET if the credentials object doesn't contain...
void dbus_free(void *memory)
Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().
dbus_int32_t _dbus_credentials_get_adt_audit_data_size(DBusCredentials *credentials)
Gets the ADT audit data size in the credentials, or 0 if the credentials object doesn't contain ADT a...
void * windows_user_data
Data for windows_user_function.
DBusAuth * _dbus_auth_server_new(const DBusString *guid)
Creates a new auth conversation object for the server side.
DBusCredentials * _dbus_auth_get_identity(DBusAuth *auth)
Gets the identity we authorized the client as.
long _dbus_transport_get_max_message_unix_fds(DBusTransport *transport)
See dbus_connection_get_max_message_unix_fds().
unsigned int allow_anonymous
TRUE if an anonymous client can connect
DBusAllowUnixUserFunction unix_user_function
Function for checking whether a user is authorized.
void _dbus_transport_set_max_received_size(DBusTransport *transport, long size)
See dbus_connection_set_max_received_size().
DBusFreeFunction free_unix_user_data
Function to free unix_user_data.
@ DBUS_DISPATCH_DATA_REMAINS
There is more data to potentially convert to messages.
dbus_bool_t _dbus_transport_get_socket_fd(DBusTransport *transport, DBusSocket *fd_p)
Get the socket file descriptor, if any.
DBUS_EXPORT int dbus_watch_get_socket(DBusWatch *watch)
Returns a socket to be watched, on UNIX this will return -1 if our transport is not socket-based so d...
unsigned int dbus_uint32_t
DBUS_PRIVATE_EXPORT void _dbus_message_loader_unref(DBusMessageLoader *loader)
Decrements the reference count of the loader and finalizes the loader when the count reaches zero.
long _dbus_message_loader_get_max_message_unix_fds(DBusMessageLoader *loader)
Gets the maximum allowed number of unix fds per message.
unsigned int disconnected
TRUE if we are disconnected.
unsigned int authenticated
Cache of auth state; use _dbus_transport_peek_is_authenticated() to query value.
DBusCredentials * _dbus_credentials_new_from_current_process(void)
Creates a new object with credentials (user ID and process ID) from the current process.
dbus_bool_t _dbus_transport_can_pass_unix_fd(DBusTransport *transport)
Returns TRUE if the transport supports sending unix fds.
const char * _dbus_auth_get_guid_from_server(DBusAuth *auth)
Gets the GUID from the server if we've authenticated; gets NULL otherwise.
Internals of DBusAddressEntry.
dbus_pid_t _dbus_credentials_get_pid(DBusCredentials *credentials)
Gets the UNIX process ID in the credentials, or DBUS_PID_UNSET if the credentials object doesn't cont...
dbus_bool_t _dbus_transport_get_unix_process_id(DBusTransport *transport, unsigned long *pid)
See dbus_connection_get_unix_process_id().
void _dbus_transport_set_pending_fds_function(DBusTransport *transport, void(*callback)(void *), void *data)
Register a function to be called whenever the number of pending file descriptors in the loader change...
long _dbus_transport_get_max_received_size(DBusTransport *transport)
See dbus_connection_get_max_received_size().
unsigned long dbus_uid_t
A user ID.
Object representing a transport such as a socket.
#define DBUS_ERROR_NO_MEMORY
There was not enough memory to complete an operation.
void _dbus_set_bad_address(DBusError *error, const char *address_problem_type, const char *address_problem_field, const char *address_problem_other)
Sets DBUS_ERROR_BAD_ADDRESS.
const char * dbus_address_entry_get_value(DBusAddressEntry *entry, const char *key)
Returns a value from a key of an entry.
Internals of DBusMessage.
void * data
Data stored at this element.
Internal members of DBusAuth.
int _dbus_transport_get_pending_fds_count(DBusTransport *transport)
Return how many file descriptors are pending in the loader.
#define DBUS_PID_UNSET
an invalid PID used to represent an uninitialized dbus_pid_t field
dbus_bool_t _dbus_transport_set_auth_mechanisms(DBusTransport *transport, const char **mechanisms)
Sets the SASL authentication mechanisms supported by this transport.
void _dbus_transport_set_max_message_unix_fds(DBusTransport *transport, long n)
See dbus_connection_set_max_message_unix_fds().
DBUS_PRIVATE_EXPORT void _dbus_connection_unref_unlocked(DBusConnection *connection)
Decrements the reference count of a DBusConnection.
dbus_bool_t _dbus_transport_init_base(DBusTransport *transport, const DBusTransportVTable *vtable, const DBusString *server_guid, const DBusString *address)
Initializes the base class members of DBusTransport.
DBUS_PRIVATE_EXPORT void _dbus_message_loader_get_buffer(DBusMessageLoader *loader, DBusString **buffer, int *max_to_read, dbus_bool_t *may_read_unix_fds)
Gets the buffer to use for reading data from the network.
dbus_bool_t dbus_error_is_set(const DBusError *error)
Checks whether an error occurred (the error is set).
#define _dbus_assert_not_reached(explanation)
long _dbus_transport_get_max_message_size(DBusTransport *transport)
See dbus_connection_get_max_message_size().
long max_live_messages_unix_fds
Max total unix fds of received messages.
void _dbus_transport_unref(DBusTransport *transport)
Decrements the reference count for the transport.
DBusMessage * _dbus_message_loader_peek_message(DBusMessageLoader *loader)
Peeks at first loaded message, returns NULL if no messages have been queued.
void(* finalize)(DBusTransport *transport)
The finalize method must free the transport.
long _dbus_counter_get_unix_fd_value(DBusCounter *counter)
Gets the current value of the unix fd counter.
void _dbus_transport_set_windows_user_function(DBusTransport *transport, DBusAllowWindowsUserFunction function, void *data, DBusFreeFunction free_data_function, void **old_data, DBusFreeFunction *old_free_data_function)
See dbus_connection_set_windows_user_function().
void _dbus_transport_finalize_base(DBusTransport *transport)
Finalizes base class members of DBusTransport.
DBUS_PRIVATE_EXPORT DBusMessageLoader * _dbus_message_loader_new(void)
Creates a new message loader.
Internals of DBusCounter.
unsigned int receive_credentials_pending
TRUE if we need to receive credentials
DBusConnection * connection
Connection owning this transport.
DBusDispatchStatus _dbus_transport_get_dispatch_status(DBusTransport *transport)
Reports our current dispatch status (whether there's buffered data to be queued as messages,...
dbus_bool_t _dbus_credentials_include(DBusCredentials *credentials, DBusCredentialType type)
Checks whether the given credential is present.
dbus_bool_t _dbus_transport_peek_is_authenticated(DBusTransport *transport)
Returns TRUE if we have been authenticated.
#define _dbus_assert(condition)
void dbus_error_free(DBusError *error)
Frees an error that's been set (or just initialized), then reinitializes the error as in dbus_error_i...
DBusCounter * live_messages
Counter for size/unix fds of all live messages.
The virtual table that must be implemented to create a new kind of transport.
DBusTransportOpenResult _dbus_transport_open_socket(DBusAddressEntry *entry, DBusTransport **transport_p, DBusError *error)
Opens a TCP socket transport.
char * _dbus_strdup(const char *str)
Duplicates a string.
DBusAuth * auth
Authentication conversation.
long max_live_messages_size
Max total size of received messages.
dbus_bool_t _dbus_credentials_are_anonymous(DBusCredentials *credentials)
Checks whether a credentials object contains a user identity.
long _dbus_counter_get_size_value(DBusCounter *counter)
Gets the current value of the size counter.
dbus_bool_t _dbus_transport_get_adt_audit_session_data(DBusTransport *transport, void **data, int *data_size)
See dbus_connection_get_adt_audit_session_data().
dbus_bool_t(* connection_set)(DBusTransport *transport)
Called when transport->connection has been filled in.
Object representing an exception.
@ DBUS_DISPATCH_NEED_MEMORY
More memory is needed to continue.
void(* disconnect)(DBusTransport *transport)
Disconnect this transport.
const char * _dbus_transport_get_server_id(DBusTransport *transport)
Gets the id of the server we are connected to (see dbus_server_get_id()).
const char * _dbus_credentials_get_linux_security_label(DBusCredentials *credentials)
Gets the Linux security label (as used by LSMs) from the credentials, or NULL if the credentials obje...
const char * _dbus_transport_get_address(DBusTransport *transport)
Gets the address of a transport.
DBUS_PRIVATE_EXPORT void _dbus_message_loader_return_buffer(DBusMessageLoader *loader, DBusString *buffer)
Returns a buffer obtained from _dbus_message_loader_get_buffer(), indicating to the loader how many b...
void dbus_set_error(DBusError *error, const char *name, const char *format,...)
Assigns an error name and message to a DBusError.
DBusAllowWindowsUserFunction windows_user_function
Function for checking whether a user is authorized.
void _dbus_credentials_unref(DBusCredentials *credentials)
Decrement refcount on credentials.
void _dbus_connection_queue_received_message_link(DBusConnection *connection, DBusList *link)
Adds a message-containing list link to the incoming message queue, taking ownership of the link and t...
void _dbus_auth_unref(DBusAuth *auth)
Decrements the refcount of an auth object.
dbus_bool_t(* DBusAllowWindowsUserFunction)(DBusConnection *connection, const char *user_sid, void *data)
Called during authentication to check whether the given Windows user ID is allowed to connect,...
dbus_bool_t _dbus_transport_queue_messages(DBusTransport *transport)
Processes data we've read while handling a watch, potentially converting some of it to messages and q...
DBusFreeFunction free_windows_user_data
Function to free windows_user_data.
void * unix_user_data
Data for unix_user_function.
dbus_bool_t dbus_parse_address(const char *address, DBusAddressEntry ***entry_result, int *array_len, DBusError *error)
Parses an address string of the form:
unsigned int send_credentials_pending
TRUE if we need to send credentials
DBusList * _dbus_message_loader_pop_message_link(DBusMessageLoader *loader)
Pops a loaded message inside a list link (passing ownership of the message and link to the caller).
Implementation details of DBusMessageLoader.
dbus_bool_t _dbus_string_move(DBusString *source, int start, DBusString *dest, int insert_at)
Moves the end of one string into another string.
DBusWatch * _dbus_watch_ref(DBusWatch *watch)
Increments the reference count of a DBusWatch object.
dbus_bool_t(* DBusAllowUnixUserFunction)(DBusConnection *connection, unsigned long uid, void *data)
Called during authentication to check whether the given UNIX user ID is allowed to connect,...
dbus_bool_t _dbus_transport_get_unix_user(DBusTransport *transport, unsigned long *uid)
See dbus_connection_get_unix_user().
void _dbus_counter_set_notify(DBusCounter *counter, long size_guard_value, long unix_fd_guard_value, DBusCounterNotifyFunction function, void *user_data)
Sets the notify function for this counter; the notify function is called whenever the counter's value...
dbus_bool_t _dbus_transport_get_is_anonymous(DBusTransport *transport)
See dbus_connection_get_is_anonymous().
DBUS_PRIVATE_EXPORT void _dbus_connection_unlock(DBusConnection *connection)
Releases the connection lock.
dbus_bool_t _dbus_transport_set_connection(DBusTransport *transport, DBusConnection *connection)
Sets the connection using this transport.
void _dbus_transport_set_unix_user_function(DBusTransport *transport, DBusAllowUnixUserFunction function, void *data, DBusFreeFunction free_data_function, void **old_data, DBusFreeFunction *old_free_data_function)
See dbus_connection_set_unix_user_function().
DBUS_PRIVATE_EXPORT DBusConnection * _dbus_connection_ref_unlocked(DBusConnection *connection)
Increments the reference count of a DBusConnection.
dbus_bool_t _dbus_transport_get_windows_user(DBusTransport *transport, char **windows_sid_p)
See dbus_connection_get_windows_user().
DBusTransport * _dbus_transport_open(DBusAddressEntry *entry, DBusError *error)
Try to open a new transport for the given address entry.
unsigned int unused_bytes_recovered
TRUE if we've recovered unused bytes from auth
void _dbus_auth_delete_unused_bytes(DBusAuth *auth)
Gets rid of unused bytes returned by _dbus_auth_get_unused_bytes() after we've gotten them and succes...
DBusAuth * _dbus_auth_client_new(void)
Creates a new auth conversation object for the client side.
dbus_bool_t _dbus_transport_handle_watch(DBusTransport *transport, DBusWatch *watch, unsigned int condition)
Handles a watch by reading data, writing data, or disconnecting the transport, as appropriate for the...
DBusCredentials * credentials
Credentials of other end read from the socket.
void _dbus_warn_check_failed(const char *format,...)
Prints a "critical" warning to stderr when an assertion fails; differs from _dbus_warn primarily in t...
void dbus_move_error(DBusError *src, DBusError *dest)
Moves an error src into dest, freeing src and overwriting dest.
dbus_uint32_t dbus_bool_t
void _dbus_auth_get_unused_bytes(DBusAuth *auth, const DBusString **str)
Returns leftover bytes that were not used as part of the auth conversation.
DBusCredentials * _dbus_credentials_new(void)
Creates a new credentials object.