00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef DBUS_SYSDEPS_UNIX_H
00026 #define DBUS_SYSDEPS_UNIX_H
00027
00028 #include <config.h>
00029 #include <dbus/dbus-sysdeps.h>
00030
00031 #ifdef DBUS_WIN
00032 #error "Don't include this on Windows"
00033 #endif
00034
00035 DBUS_BEGIN_DECLS
00036
00044 dbus_bool_t
00045 _dbus_close (int fd,
00046 DBusError *error);
00047 int
00048 _dbus_read (int fd,
00049 DBusString *buffer,
00050 int count);
00051 int
00052 _dbus_write (int fd,
00053 const DBusString *buffer,
00054 int start,
00055 int len);
00056 int
00057 _dbus_write_two (int fd,
00058 const DBusString *buffer1,
00059 int start1,
00060 int len1,
00061 const DBusString *buffer2,
00062 int start2,
00063 int len2);
00064
00065 dbus_bool_t _dbus_open_unix_socket (int *fd,
00066 DBusError *error);
00067 int _dbus_connect_unix_socket (const char *path,
00068 dbus_bool_t abstract,
00069 DBusError *error);
00070 int _dbus_listen_unix_socket (const char *path,
00071 dbus_bool_t abstract,
00072 DBusError *error);
00073
00074 dbus_bool_t _dbus_read_credentials (int client_fd,
00075 DBusCredentials *credentials,
00076 DBusError *error);
00077 dbus_bool_t _dbus_send_credentials (int server_fd,
00078 DBusError *error);
00079
00081 typedef struct DBusUserInfo DBusUserInfo;
00083 typedef struct DBusGroupInfo DBusGroupInfo;
00084
00088 struct DBusUserInfo
00089 {
00090 dbus_uid_t uid;
00091 dbus_gid_t primary_gid;
00092 dbus_gid_t *group_ids;
00093 int n_group_ids;
00094 char *username;
00095 char *homedir;
00096 };
00097
00101 struct DBusGroupInfo
00102 {
00103 dbus_gid_t gid;
00104 char *groupname;
00105 };
00106
00107 dbus_bool_t _dbus_user_info_fill (DBusUserInfo *info,
00108 const DBusString *username,
00109 DBusError *error);
00110 dbus_bool_t _dbus_user_info_fill_uid (DBusUserInfo *info,
00111 dbus_uid_t uid,
00112 DBusError *error);
00113 void _dbus_user_info_free (DBusUserInfo *info);
00114
00115 dbus_bool_t _dbus_group_info_fill (DBusGroupInfo *info,
00116 const DBusString *groupname,
00117 DBusError *error);
00118 dbus_bool_t _dbus_group_info_fill_gid (DBusGroupInfo *info,
00119 dbus_gid_t gid,
00120 DBusError *error);
00121 void _dbus_group_info_free (DBusGroupInfo *info);
00122
00123 dbus_uid_t _dbus_getuid (void);
00124 dbus_uid_t _dbus_geteuid (void);
00125 dbus_gid_t _dbus_getgid (void);
00126
00127 dbus_bool_t _dbus_parse_uid (const DBusString *uid_str,
00128 dbus_uid_t *uid);
00129
00132 DBUS_END_DECLS
00133
00134 #endif