index.html
Main Page
|
modules.html
Modules
|
namespaces.html
Namespace List
|
hierarchy.html
Class Hierarchy
|
annotated.html
Data Structures
|
dirs.html
Directories
|
files.html
File List
|
namespacemembers.html
Namespace Members
|
functions.html
Data Fields
|
pages.html
Related Pages
keyring class
[
group__DBusInternals.html
D-BUS internal implementation details
]
structDBusKeyring.html
DBusKeyring
data structure.
#_details
More...
Functions
structDBusKeyring.html
DBusKeyring
*
group__DBusKeyring.html#ga0
_dbus_keyring_ref
(
structDBusKeyring.html
DBusKeyring
*keyring)
Increments reference count of the keyring.
#ga0
void
group__DBusKeyring.html#ga1
_dbus_keyring_unref
(
structDBusKeyring.html
DBusKeyring
*keyring)
Decrements refcount and finalizes if it reaches zero.
#ga1
structDBusKeyring.html
DBusKeyring
*
group__DBusKeyring.html#ga2
_dbus_keyring_new_homedir
(const
structDBusString.html
DBusString
*username, const
structDBusString.html
DBusString
*context,
structDBusError.html
DBusError
*error)
Creates a new keyring that lives in the ~/.dbus-keyrings directory of the given user.
#ga2
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusKeyring.html#ga3
_dbus_keyring_validate_context
(const
structDBusString.html
DBusString
*context)
Checks whether the context is a valid context.
#ga3
int
group__DBusKeyring.html#ga5
_dbus_keyring_get_best_key
(
structDBusKeyring.html
DBusKeyring
*keyring,
structDBusError.html
DBusError
*error)
Gets a recent key to use for authentication.
#ga5
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusKeyring.html#ga6
_dbus_keyring_is_for_user
(
structDBusKeyring.html
DBusKeyring
*keyring, const
structDBusString.html
DBusString
*username)
Checks whether the keyring is for the given username.
#ga6
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusKeyring.html#ga7
_dbus_keyring_get_hex_key
(
structDBusKeyring.html
DBusKeyring
*keyring, int key_id,
structDBusString.html
DBusString
*hex_key)
Gets the hex-encoded secret key for the given ID.
#ga7
Detailed Description
structDBusKeyring.html
DBusKeyring
data structure.
Types and functions related to
structDBusKeyring.html
DBusKeyring
.
structDBusKeyring.html
DBusKeyring
is intended to manage cookies used to authenticate clients to servers. This is essentially the "verify that client can read the user's homedir" authentication mechanism. Both client and server must have access to the homedir.
The secret keys are not kept in locked memory, and are written to a file in the user's homedir. However they are transient (only used by a single server instance for a fixed period of time, then discarded). Also, the keys are not sent over the wire.
todo.html#_todo000024
Todo:
there's a memory leak on some codepath in here, I saw it once when running make check - probably some specific initial cookies present in the cookie file, then depending on what we do with them.
Function Documentation
int _dbus_keyring_get_best_key
(
structDBusKeyring.html
DBusKeyring
*
keyring
,
structDBusError.html
DBusError
*
error
)
Gets a recent key to use for authentication.
If no recent key exists, creates one. Returns the key ID. If a key can't be written to the keyring file so no recent key can be created, returns -1. All valid keys are > 0.
Parameters:
keyring
the keyring
error
error on failure
Returns:
key ID to use for auth, or -1 on failure
Definition at line
dbus-keyring_8c-source.html#l00971
971
of file
dbus-keyring_8c-source.html
dbus-keyring.c
.
References
dbus-errors_8c-source.html#l00201
dbus_set_error_const()
,
dbus-keyring_8c-source.html#l00094
DBusKey::id
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_keyring_get_hex_key
(
structDBusKeyring.html
DBusKeyring
*
keyring
,
int
key_id
,
structDBusString.html
DBusString
*
hex_key
)
Gets the hex-encoded secret key for the given ID.
Returns
group__DBusMacros.html#ga3
FALSE
if not enough memory. Returns
group__DBusMacros.html#ga2
TRUE
but empty key on any other error such as unknown key ID.
Parameters:
keyring
the keyring
key_id
the key ID
hex_key
string to append hex-encoded key to
Returns:
group__DBusMacros.html#ga2
TRUE
if we had enough memory
Definition at line
dbus-keyring_8c-source.html#l01029
1029
of file
dbus-keyring_8c-source.html
dbus-keyring.c
.
References
dbus-string_8c-source.html#l02306
_dbus_string_hex_encode()
,
dbus-keyring_8c-source.html#l00118
keys
,
dbus-keyring_8c-source.html#l00119
n_keys
,
group__DBusMacros.html#ga4
NULL
,
dbus-keyring_8c-source.html#l00101
DBusKey::secret
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_keyring_is_for_user
(
structDBusKeyring.html
DBusKeyring
*
keyring
,
const
structDBusString.html
DBusString
*
username
)
Checks whether the keyring is for the given username.
Parameters:
keyring
the keyring
username
the username to check
Returns:
group__DBusMacros.html#ga2
TRUE
if the keyring belongs to the given user
Definition at line
dbus-keyring_8c-source.html#l01010
1010
of file
dbus-keyring_8c-source.html
dbus-keyring.c
.
References
dbus-string_8c-source.html#l02056
_dbus_string_equal()
, and
dbus-keyring_8c-source.html#l00114
username
.
structDBusKeyring.html
DBusKeyring
* _dbus_keyring_new_homedir
(
const
structDBusString.html
DBusString
*
username
,
const
structDBusString.html
DBusString
*
context
,
structDBusError.html
DBusError
*
error
)
Creates a new keyring that lives in the ~/.dbus-keyrings directory of the given user.
If the username is
group__DBusMacros.html#ga4
NULL
, uses the user owning the current process.
Parameters:
username
username to get keyring for, or
group__DBusMacros.html#ga4
NULL
context
which keyring to get
error
return location for errors
Returns:
the keyring or
group__DBusMacros.html#ga4
NULL
on error
Definition at line
dbus-keyring_8c-source.html#l00715
715
of file
dbus-keyring_8c-source.html
dbus-keyring.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-sysdeps_8c-source.html#l02363
_dbus_concat_dir_and_file()
,
dbus-sysdeps_8c-source.html#l02329
_dbus_create_directory()
,
dbus-sysdeps_8c-source.html#l00172
_dbus_getenv()
,
dbus-userdb_8c-source.html#l00344
_dbus_homedir_from_current_process()
,
dbus-userdb_8c-source.html#l00366
_dbus_homedir_from_username()
,
dbus-keyring_8c-source.html#l00689
_dbus_keyring_unref()
,
dbus-keyring_8c-source.html#l00875
_dbus_keyring_validate_context()
,
dbus-string_8c-source.html#l00986
_dbus_string_append()
,
dbus-string_8c-source.html#l01472
_dbus_string_copy()
,
dbus-string_8c-source.html#l00261
_dbus_string_free()
,
dbus-string_8c-source.html#l00174
_dbus_string_init()
,
dbus-string_8c-source.html#l00208
_dbus_string_init_const()
,
dbus-string_8c-source.html#l00853
_dbus_string_set_length()
,
dbus-userdb_8c-source.html#l00322
_dbus_username_from_current_process()
,
dbus-internals_8c-source.html#l00203
_dbus_warn()
,
dbus-errors_8c-source.html#l00174
dbus_error_free()
,
dbus-errors_8c-source.html#l00151
dbus_error_init()
,
dbus-errors_8c-source.html#l00313
dbus_set_error()
,
dbus-errors_8c-source.html#l00201
dbus_set_error_const()
,
dbus-keyring_8c-source.html#l00115
directory
,
group__DBusMacros.html#ga3
FALSE
,
dbus-keyring_8c-source.html#l00116
filename
,
dbus-keyring_8c-source.html#l00117
filename_lock
,
dbus-errors_8h-source.html#l00044
DBusError::message
,
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga2
TRUE
, and
dbus-keyring_8c-source.html#l00114
username
.
structDBusKeyring.html
DBusKeyring
* _dbus_keyring_ref
(
structDBusKeyring.html
DBusKeyring
*
keyring
)
Increments reference count of the keyring.
Parameters:
keyring
the keyring
Returns:
the keyring
Definition at line
dbus-keyring_8c-source.html#l00675
675
of file
dbus-keyring_8c-source.html
dbus-keyring.c
.
References
dbus-keyring_8c-source.html#l00113
refcount
.
void _dbus_keyring_unref
(
structDBusKeyring.html
DBusKeyring
*
keyring
)
Decrements refcount and finalizes if it reaches zero.
Parameters:
keyring
the keyring
Definition at line
dbus-keyring_8c-source.html#l00689
689
of file
dbus-keyring_8c-source.html
dbus-keyring.c
.
References
dbus-string_8c-source.html#l00261
_dbus_string_free()
,
dbus-memory_8c-source.html#l00612
dbus_free()
,
dbus-keyring_8c-source.html#l00115
directory
,
dbus-keyring_8c-source.html#l00116
filename
,
dbus-keyring_8c-source.html#l00117
filename_lock
,
dbus-keyring_8c-source.html#l00118
keys
,
dbus-keyring_8c-source.html#l00119
n_keys
,
dbus-keyring_8c-source.html#l00113
refcount
, and
dbus-keyring_8c-source.html#l00114
username
.
Referenced by
dbus-auth_8c-source.html#l02074
_dbus_auth_unref()
, and
dbus-keyring_8c-source.html#l00715
_dbus_keyring_new_homedir()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_keyring_validate_context
(
const
structDBusString.html
DBusString
*
context
)
Checks whether the context is a valid context.
Contexts that might cause confusion when used in filenames are not allowed (contexts can't start with a dot or contain dir separators).
todo.html#_todo000025
Todo:
this is the most inefficient implementation imaginable.
Parameters:
context
the context
Returns:
group__DBusMacros.html#ga2
TRUE
if valid
Definition at line
dbus-keyring_8c-source.html#l00875
875
of file
dbus-keyring_8c-source.html
dbus-keyring.c
.
References
dbus-string_8c-source.html#l01783
_dbus_string_find()
,
dbus-string_8c-source.html#l01878
_dbus_string_find_blank()
,
dbus-string_8c-source.html#l02497
_dbus_string_validate_ascii()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-keyring_8c-source.html#l00715
_dbus_keyring_new_homedir()
.
Generated on Tue Sep 13 01:28:09 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
