*
*/
+/* #define ENABLE_DBUSGROUPINFO */
+
+#ifdef ENABLE_DBUSGROUPINFO
+typedef struct {
+ int gid;
+ char *groupname;
+} DBusGroupInfo;
+#endif
+
#undef open
#define STRSAFE_NO_DEPRECATE
}
/**
+ * Verify that after the fork we can successfully change to this user.
+ *
+ * @param user the username given in the daemon configuration
+ * @returns #TRUE if username is valid
+ */
+dbus_bool_t
+_dbus_verify_daemon_user (const char *user)
+{
+ return TRUE;
+}
+
+/**
+ * Changes the user and group the bus is running as.
+ *
+ * @param user the user to become
+ * @param error return location for errors
+ * @returns #FALSE on failure
+ */
+dbus_bool_t
+_dbus_change_to_daemon_user (const char *user,
+ DBusError *error)
+{
+ return TRUE;
+}
+
+/**
* Changes the user and group the bus is running as.
*
* @param uid the new user ID
return FALSE;
}
-
+#ifdef ENABLE_DBUSGROPINFO
static dbus_bool_t
fill_group_info(DBusGroupInfo *info,
dbus_gid_t gid,
return fill_group_info (info, DBUS_GID_UNSET,
groupname, error);
}
+#endif
/** @} */ /* End of DBusInternalsUtils functions */
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
+
+/* #define ENABLE_DBUSUSERINFO */
+
+typedef struct DBusCredentials{
+ int uid;
+ int gid;
+ int pid;
+} DBusCredentials;
+
#undef open
#define STRSAFE_NO_DEPRECATE
_DBUS_DEFINE_GLOBAL_LOCK (win_fds);
_DBUS_DEFINE_GLOBAL_LOCK (sid_atom_cache);
+#ifdef ENABLE_DBUSUSERINFO
+typedef struct {
+ int uid;
+ char *username;
+ int n_group_ids;
+ dbus_gid_t *group_ids;
+ int primary_gid;
+ char *homedir;
+} DBusUserInfo;
+#endif
static
void
return 0;
}
+#if 0
/**
* @def _DBUS_MAX_SUN_PATH_LENGTH
*
return listen_handle;
#endif //DBUS_WINCE
}
+#endif
#if 0
return retval;
}
-
+#ifdef ENABLE_DBUSUSERINFO
dbus_bool_t
fill_win_user_info_name_and_groups (wchar_t *wname,
wchar_t *wdomain,
#endif //DBUS_WINCE
}
-
+#endif
void
dbus_bool_t
-write_credentials_byte (int handle,
+_dbus_send_credentials_socket (int handle,
DBusError *error)
{
/* FIXME: for the session bus credentials shouldn't matter (?), but
* @returns #TRUE on success
*/
dbus_bool_t
-_dbus_read_credentials_unix_socket (int handle,
+_dbus_read_credentials_socket (int handle,
DBusCredentials *credentials,
DBusError *error)
{
return TRUE;
}
-
-/**
- * Gets user info for the given user ID.
- *
- * @param info user info object to initialize
- * @param uid the user ID
- * @param error error return
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_user_info_fill_uid (DBusUserInfo *info,
- dbus_uid_t uid,
- DBusError *error)
-{
- return fill_user_info (info, uid,
- NULL, error);
-}
-
-/**
- * Gets user info for the given username.
- *
- * @param info user info object to initialize
- * @param username the username
- * @param error error return
- * @returns #TRUE on success
- */
-dbus_bool_t
-_dbus_user_info_fill (DBusUserInfo *info,
- const DBusString *username,
- DBusError *error)
-{
- return fill_user_info (info, DBUS_UID_UNSET,
- username, error);
-}
-
-
+#ifdef ENABLE_DBUSUSERINFO
dbus_bool_t
fill_user_info (DBusUserInfo *info,
dbus_uid_t uid,
return TRUE;
}
+/**
+ * Gets user info for the given user ID.
+ *
+ * @param info user info object to initialize
+ * @param uid the user ID
+ * @param error error return
+ * @returns #TRUE on success
+ */
+dbus_bool_t
+_dbus_user_info_fill_uid (DBusUserInfo *info,
+ dbus_uid_t uid,
+ DBusError *error)
+{
+ return fill_user_info (info, uid,
+ NULL, error);
+}
+
+/**
+ * Gets user info for the given username.
+ *
+ * @param info user info object to initialize
+ * @param username the username
+ * @param error error return
+ * @returns #TRUE on success
+ */
+dbus_bool_t
+_dbus_user_info_fill (DBusUserInfo *info,
+ const DBusString *username,
+ DBusError *error)
+{
+ return fill_user_info (info, DBUS_UID_UNSET,
+ username, error);
+}
+#endif
/**
* Appends the given filename to the given directory.
_dbus_string_get_length (dir));
}
-
-
+/**
+ * Append to the string the identity we would like to have when we authenticate,
+ * on UNIX this is the current process UID and on Windows something else.
+ * No escaping is required, that is done in dbus-auth.c.
+ *
+ * @param str the string to append to
+ * @returns #FALSE on no memory
+ */
+dbus_bool_t
+_dbus_append_desired_identity (DBusString *str)
+{
+ /* FIXME: */
+ return _dbus_string_append_uint (str,
+ _dbus_getuid ());
+}
/**
* Gets our process ID
}
#endif
-/**
- * Sends a single nul byte with our UNIX credentials as ancillary
- * data. Returns #TRUE if the data was successfully written. On
- * systems that don't support sending credentials, just writes a byte,
- * doesn't send any credentials. On some systems, such as Linux,
- * reading/writing the byte isn't actually required, but we do it
- * anyway just to avoid multiple codepaths.
- *
- * Fails if no byte can be written, so you must select() first.
- *
- * The point of the byte is that on some systems we have to
- * use sendmsg()/recvmsg() to transmit credentials.
- *
- * @param server_fd file descriptor for connection to server
- * @param error return location for error code
- * @returns #TRUE if the byte was sent
- */
-dbus_bool_t
-_dbus_send_credentials_unix_socket (int server_fd,
- DBusError *error)
-{
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (write_credentials_byte (server_fd, error))
- return TRUE;
- else
- return FALSE;
-}
-
static dbus_uint32_t fromAscii(char ascii)
{
if(ascii >= '0' && ascii <= '9')
}
+dbus_bool_t _dbus_windows_user_is_process_owner (const char *windows_sid)
+{
+ return TRUE;
+}
+
+
/** @} end of sysdeps-win */
/* tests in dbus-sysdeps-util.c */