diff options
author | Havoc Pennington <hp@redhat.com> | 2003-01-04 07:28:54 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-01-04 07:28:54 +0000 |
commit | 01af5ff4101e540a6456bca01d56272e701bea78 (patch) | |
tree | a5b0fc81b99e3b0564d0b2cc2ac4c20196a051f0 /dbus/dbus-sysdeps.h | |
parent | 1ed128b52484d95e30f7437bf87f34d85371f1f8 (diff) |
2003-01-04 Havoc Pennington <hp@pobox.com>
* test/watch.c (error_handler): make it safe if the error handler
is called multiple times (if we s/error handler/disconnect
handler/ we should just guarantee it's called only once)
* dbus/dbus-transport.c (_dbus_transport_disconnect): call the
error handler on disconnect (it's quite possible we should
just change the error handler to a "disconnect handler," I'm
not sure we have any other meaningful errors)
* configure.in: check for getpwnam_r
* dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
mechanism as in SASL spec, using socket credentials
* dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
(_dbus_send_credentials_unix_socket): new function
* dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
dbus_accept()
(_dbus_write): only check errno if <0 returned
(_dbus_write_two): ditto
Diffstat (limited to 'dbus/dbus-sysdeps.h')
-rw-r--r-- | dbus/dbus-sysdeps.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h index 17d96b3d..73482f06 100644 --- a/dbus/dbus-sysdeps.h +++ b/dbus/dbus-sysdeps.h @@ -65,12 +65,36 @@ int _dbus_write_two (int fd, int start2, int len2); +typedef struct +{ + /* -1 if not available */ + int pid; + int uid; + int gid; +} DBusCredentials; + int _dbus_connect_unix_socket (const char *path, DBusResultCode *result); int _dbus_listen_unix_socket (const char *path, DBusResultCode *result); -int _dbus_accept_unix_socket (int listen_fd); +int _dbus_accept (int listen_fd); + +dbus_bool_t _dbus_read_credentials_unix_socket (int client_fd, + DBusCredentials *credentials, + DBusResultCode *result); +dbus_bool_t _dbus_send_credentials_unix_socket (int server_fd, + DBusResultCode *result); + + +dbus_bool_t _dbus_credentials_from_username (const DBusString *username, + DBusCredentials *credentials); +dbus_bool_t _dbus_credentials_from_uid_string (const DBusString *uid_str, + DBusCredentials *credentials); +void _dbus_credentials_from_current_process (DBusCredentials *credentials); +dbus_bool_t _dbus_credentials_match (const DBusCredentials *expected_credentials, + const DBusCredentials *provided_credentials); +dbus_bool_t _dbus_string_append_our_uid (DBusString *str); DBUS_END_DECLS; |