Commit 98917b1e authored by William Jon McCann's avatar William Jon McCann Committed by William Jon McCann

Initial support for XDMCP IndirectQuery choosers. Also fix broken

2008-01-30  William Jon McCann  <mccann@jhu.edu>

	* common/gdm-address.c: (add_local_siocgifconf),
	(add_local_addrinfo), (gdm_address_peek_local_list):
	* daemon/Makefile.am:
	* daemon/gdm-chooser-server.c: (generate_address),
	(handle_select_hostname), (handle_disconnect),
	(chooser_handle_child_message), (do_introspect),
	(chooser_server_message_handler),
	(chooser_server_unregister_handler), (connection_filter_function),
	(allow_user_function), (handle_connection),
	(gdm_chooser_server_start), (gdm_chooser_server_stop),
	(gdm_chooser_server_get_address),
	(_gdm_chooser_server_set_display_id),
	(_gdm_chooser_server_set_user_name),
	(_gdm_chooser_server_set_group_name),
	(gdm_chooser_server_set_property),
	(gdm_chooser_server_get_property),
	(gdm_chooser_server_constructor), (gdm_chooser_server_class_init),
	(gdm_chooser_server_init), (gdm_chooser_server_finalize),
	(gdm_chooser_server_new):
	* daemon/gdm-chooser-server.h:
	* daemon/gdm-chooser-session.c: (listify_hash),
	(get_chooser_environment), (chooser_session_child_watch),
	(spawn_child_setup), (spawn_command_line_sync_as_user),
	(spawn_command_line_async_as_user), (parse_value_as_integer),
	(parse_dbus_launch_output), (start_dbus_daemon),
	(stop_dbus_daemon), (gdm_chooser_session_spawn),
	(gdm_chooser_session_start), (wait_on_child),
	(chooser_session_died), (gdm_chooser_session_stop),
	(gdm_chooser_session_set_server_address),
	(_gdm_chooser_session_set_x11_display_name),
	(_gdm_chooser_session_set_x11_display_hostname),
	(_gdm_chooser_session_set_x11_display_device),
	(_gdm_chooser_session_set_x11_authority_file),
	(_gdm_chooser_session_set_user_name),
	(_gdm_chooser_session_set_group_name),
	(gdm_chooser_session_set_property),
	(gdm_chooser_session_get_property),
	(gdm_chooser_session_constructor),
	(gdm_chooser_session_class_init), (gdm_chooser_session_init),
	(gdm_chooser_session_finalize), (gdm_chooser_session_new):
	* daemon/gdm-chooser-session.h:
	* daemon/gdm-display.c: (gdm_display_real_set_slave_bus_name),
	(gdm_display_set_slave_bus_name), (gdm_display_class_init):
	* daemon/gdm-display.h:
	* daemon/gdm-display.xml:
	* daemon/gdm-factory-slave.c:
	* daemon/gdm-greeter-server.c:
	* daemon/gdm-greeter-session.c: (gdm_greeter_session_init):
	* daemon/gdm-product-slave.c:
	* daemon/gdm-simple-slave.c:
	* daemon/gdm-slave.c: (gdm_slave_set_slave_bus_name),
	(gdm_slave_real_start), (register_slave), (gdm_slave_constructor):
	* daemon/gdm-xdmcp-chooser-display.c: (on_hostname_selected),
	(gdm_xdmcp_chooser_display_set_slave_bus_name),
	(gdm_xdmcp_chooser_display_manage),
	(gdm_xdmcp_chooser_display_class_init),
	(gdm_xdmcp_chooser_display_init),
	(gdm_xdmcp_chooser_display_finalize),
	(gdm_xdmcp_chooser_display_new):
	* daemon/gdm-xdmcp-chooser-display.h:
	* daemon/gdm-xdmcp-chooser-display.xml:
	* daemon/gdm-xdmcp-chooser-slave.c: (on_chooser_session_start),
	(on_chooser_session_stop), (on_chooser_session_exited),
	(on_chooser_session_died), (on_chooser_hostname_selected),
	(on_chooser_disconnected), (on_chooser_connected), (setup_server),
	(run_chooser), (idle_connect_to_display),
	(gdm_xdmcp_chooser_slave_run), (gdm_xdmcp_chooser_slave_start),
	(gdm_xdmcp_chooser_slave_stop),
	(gdm_xdmcp_chooser_slave_set_property),
	(gdm_xdmcp_chooser_slave_get_property),
	(gdm_xdmcp_chooser_slave_constructor),
	(gdm_xdmcp_chooser_slave_class_init),
	(gdm_xdmcp_chooser_slave_init), (gdm_xdmcp_chooser_slave_finalize),
	(gdm_xdmcp_chooser_slave_new):
	* daemon/gdm-xdmcp-chooser-slave.h:
	* daemon/gdm-xdmcp-display-factory.c: (set_port_for_request),
	(gdm_xdmcp_send_forward_query), (indirect_client_create),
	(indirect_client_destroy), (indirect_client_lookup_by_chosen),
	(indirect_client_lookup), (gdm_xdmcp_handle_indirect_query),
	(forward_query_destroy), (remove_oldest_forward),
	(forward_query_create), (forward_query_lookup),
	(gdm_xdmcp_handle_forward_query), (gdm_xdmcp_send_decline),
	(on_hostname_selected), (gdm_xdmcp_display_create),
	(gdm_xdmcp_handle_request), (gdm_xdmcp_send_refuse),
	(gdm_xdmcp_handle_manage), (gdm_xdmcp_handle_managed_forward):
	* daemon/gdm-xdmcp-display.c: (gdm_xdmcp_display_class_init),
	(gdm_xdmcp_display_finalize):
	* daemon/gdm-xdmcp-display.h:
	* daemon/gdm-xdmcp-display.xml:
	* daemon/gdm-xdmcp-greeter-display.c:
	(gdm_xdmcp_greeter_display_class_init),
	(gdm_xdmcp_greeter_display_init),
	(gdm_xdmcp_greeter_display_finalize),
	(gdm_xdmcp_greeter_display_new):
	* daemon/gdm-xdmcp-greeter-display.h:
	* daemon/xdmcp-chooser-slave-main.c: (get_system_bus), (signal_cb),
	(on_slave_stopped), (main):
	* data/gdm.conf:
	* gui/simple-chooser/Makefile.am:
	* gui/simple-chooser/chooser-main.c: (assistive_registry_launch),
	(filter_watch), (filter_timeout), (assistive_registry_start),
	(at_set_gtk_modules), (load_a11y), (main):
	* gui/simple-chooser/gdm-chooser-client.c:
	(gdm_chooser_client_error_quark), (send_dbus_string_method),
	(send_dbus_void_method), (gdm_chooser_client_call_select_hostname),
	(gdm_chooser_client_call_disconnect), (client_dbus_handle_message),
	(client_dbus_filter_function), (gdm_chooser_client_start),
	(gdm_chooser_client_stop), (gdm_chooser_client_set_property),
	(gdm_chooser_client_get_property),
	(gdm_chooser_client_constructor), (gdm_chooser_client_dispose),
	(gdm_chooser_client_class_init), (gdm_chooser_client_init),
	(gdm_chooser_client_finalize), (gdm_chooser_client_new):
	* gui/simple-chooser/gdm-chooser-client.h:
	* gui/simple-chooser/gdm-chooser-session.c: (launch_compiz),
	(launch_metacity), (start_window_manager), (start_settings_daemon),
	(on_dialog_response), (gdm_chooser_session_start),
	(gdm_chooser_session_stop), (gdm_chooser_session_set_property),
	(gdm_chooser_session_get_property),
	(gdm_chooser_session_constructor), (gdm_chooser_session_dispose),
	(gdm_chooser_session_class_init), (gdm_chooser_session_init),
	(gdm_chooser_session_finalize), (gdm_chooser_session_new):
	* gui/simple-chooser/gdm-chooser-session.h:
	* gui/simple-chooser/test-host-chooser.c:
	(assistive_registry_launch), (filter_watch), (filter_timeout),
	(assistive_registry_start), (at_set_gtk_modules), (load_a11y),
	(main):
	* gui/simple-greeter/greeter-main.c: (load_a11y), (main):
	Initial support for XDMCP IndirectQuery choosers.
	Also fix broken gdm_address_is_local.


svn path=/trunk/; revision=5645
parent 17014d50
2008-01-30 William Jon McCann <mccann@jhu.edu>
* common/gdm-address.c: (add_local_siocgifconf),
(add_local_addrinfo), (gdm_address_peek_local_list):
* daemon/Makefile.am:
* daemon/gdm-chooser-server.c: (generate_address),
(handle_select_hostname), (handle_disconnect),
(chooser_handle_child_message), (do_introspect),
(chooser_server_message_handler),
(chooser_server_unregister_handler), (connection_filter_function),
(allow_user_function), (handle_connection),
(gdm_chooser_server_start), (gdm_chooser_server_stop),
(gdm_chooser_server_get_address),
(_gdm_chooser_server_set_display_id),
(_gdm_chooser_server_set_user_name),
(_gdm_chooser_server_set_group_name),
(gdm_chooser_server_set_property),
(gdm_chooser_server_get_property),
(gdm_chooser_server_constructor), (gdm_chooser_server_class_init),
(gdm_chooser_server_init), (gdm_chooser_server_finalize),
(gdm_chooser_server_new):
* daemon/gdm-chooser-server.h:
* daemon/gdm-chooser-session.c: (listify_hash),
(get_chooser_environment), (chooser_session_child_watch),
(spawn_child_setup), (spawn_command_line_sync_as_user),
(spawn_command_line_async_as_user), (parse_value_as_integer),
(parse_dbus_launch_output), (start_dbus_daemon),
(stop_dbus_daemon), (gdm_chooser_session_spawn),
(gdm_chooser_session_start), (wait_on_child),
(chooser_session_died), (gdm_chooser_session_stop),
(gdm_chooser_session_set_server_address),
(_gdm_chooser_session_set_x11_display_name),
(_gdm_chooser_session_set_x11_display_hostname),
(_gdm_chooser_session_set_x11_display_device),
(_gdm_chooser_session_set_x11_authority_file),
(_gdm_chooser_session_set_user_name),
(_gdm_chooser_session_set_group_name),
(gdm_chooser_session_set_property),
(gdm_chooser_session_get_property),
(gdm_chooser_session_constructor),
(gdm_chooser_session_class_init), (gdm_chooser_session_init),
(gdm_chooser_session_finalize), (gdm_chooser_session_new):
* daemon/gdm-chooser-session.h:
* daemon/gdm-display.c: (gdm_display_real_set_slave_bus_name),
(gdm_display_set_slave_bus_name), (gdm_display_class_init):
* daemon/gdm-display.h:
* daemon/gdm-display.xml:
* daemon/gdm-factory-slave.c:
* daemon/gdm-greeter-server.c:
* daemon/gdm-greeter-session.c: (gdm_greeter_session_init):
* daemon/gdm-product-slave.c:
* daemon/gdm-simple-slave.c:
* daemon/gdm-slave.c: (gdm_slave_set_slave_bus_name),
(gdm_slave_real_start), (register_slave), (gdm_slave_constructor):
* daemon/gdm-xdmcp-chooser-display.c: (on_hostname_selected),
(gdm_xdmcp_chooser_display_set_slave_bus_name),
(gdm_xdmcp_chooser_display_manage),
(gdm_xdmcp_chooser_display_class_init),
(gdm_xdmcp_chooser_display_init),
(gdm_xdmcp_chooser_display_finalize),
(gdm_xdmcp_chooser_display_new):
* daemon/gdm-xdmcp-chooser-display.h:
* daemon/gdm-xdmcp-chooser-display.xml:
* daemon/gdm-xdmcp-chooser-slave.c: (on_chooser_session_start),
(on_chooser_session_stop), (on_chooser_session_exited),
(on_chooser_session_died), (on_chooser_hostname_selected),
(on_chooser_disconnected), (on_chooser_connected), (setup_server),
(run_chooser), (idle_connect_to_display),
(gdm_xdmcp_chooser_slave_run), (gdm_xdmcp_chooser_slave_start),
(gdm_xdmcp_chooser_slave_stop),
(gdm_xdmcp_chooser_slave_set_property),
(gdm_xdmcp_chooser_slave_get_property),
(gdm_xdmcp_chooser_slave_constructor),
(gdm_xdmcp_chooser_slave_class_init),
(gdm_xdmcp_chooser_slave_init), (gdm_xdmcp_chooser_slave_finalize),
(gdm_xdmcp_chooser_slave_new):
* daemon/gdm-xdmcp-chooser-slave.h:
* daemon/gdm-xdmcp-display-factory.c: (set_port_for_request),
(gdm_xdmcp_send_forward_query), (indirect_client_create),
(indirect_client_destroy), (indirect_client_lookup_by_chosen),
(indirect_client_lookup), (gdm_xdmcp_handle_indirect_query),
(forward_query_destroy), (remove_oldest_forward),
(forward_query_create), (forward_query_lookup),
(gdm_xdmcp_handle_forward_query), (gdm_xdmcp_send_decline),
(on_hostname_selected), (gdm_xdmcp_display_create),
(gdm_xdmcp_handle_request), (gdm_xdmcp_send_refuse),
(gdm_xdmcp_handle_manage), (gdm_xdmcp_handle_managed_forward):
* daemon/gdm-xdmcp-display.c: (gdm_xdmcp_display_class_init),
(gdm_xdmcp_display_finalize):
* daemon/gdm-xdmcp-display.h:
* daemon/gdm-xdmcp-display.xml:
* daemon/gdm-xdmcp-greeter-display.c:
(gdm_xdmcp_greeter_display_class_init),
(gdm_xdmcp_greeter_display_init),
(gdm_xdmcp_greeter_display_finalize),
(gdm_xdmcp_greeter_display_new):
* daemon/gdm-xdmcp-greeter-display.h:
* daemon/xdmcp-chooser-slave-main.c: (get_system_bus), (signal_cb),
(on_slave_stopped), (main):
* data/gdm.conf:
* gui/simple-chooser/Makefile.am:
* gui/simple-chooser/chooser-main.c: (assistive_registry_launch),
(filter_watch), (filter_timeout), (assistive_registry_start),
(at_set_gtk_modules), (load_a11y), (main):
* gui/simple-chooser/gdm-chooser-client.c:
(gdm_chooser_client_error_quark), (send_dbus_string_method),
(send_dbus_void_method), (gdm_chooser_client_call_select_hostname),
(gdm_chooser_client_call_disconnect), (client_dbus_handle_message),
(client_dbus_filter_function), (gdm_chooser_client_start),
(gdm_chooser_client_stop), (gdm_chooser_client_set_property),
(gdm_chooser_client_get_property),
(gdm_chooser_client_constructor), (gdm_chooser_client_dispose),
(gdm_chooser_client_class_init), (gdm_chooser_client_init),
(gdm_chooser_client_finalize), (gdm_chooser_client_new):
* gui/simple-chooser/gdm-chooser-client.h:
* gui/simple-chooser/gdm-chooser-session.c: (launch_compiz),
(launch_metacity), (start_window_manager), (start_settings_daemon),
(on_dialog_response), (gdm_chooser_session_start),
(gdm_chooser_session_stop), (gdm_chooser_session_set_property),
(gdm_chooser_session_get_property),
(gdm_chooser_session_constructor), (gdm_chooser_session_dispose),
(gdm_chooser_session_class_init), (gdm_chooser_session_init),
(gdm_chooser_session_finalize), (gdm_chooser_session_new):
* gui/simple-chooser/gdm-chooser-session.h:
* gui/simple-chooser/test-host-chooser.c:
(assistive_registry_launch), (filter_watch), (filter_timeout),
(assistive_registry_start), (at_set_gtk_modules), (load_a11y),
(main):
* gui/simple-greeter/greeter-main.c: (load_a11y), (main):
Initial support for XDMCP IndirectQuery choosers.
Also fix broken gdm_address_is_local.
2008-01-29 William Jon McCann <mccann@jhu.edu>
* configure.ac:
......
......@@ -30,6 +30,8 @@
#include <sys/socket.h>
#endif
#include <netdb.h>
#include <sys/ioctl.h>
#include <net/if.h>
#ifndef G_OS_WIN32
#include <sys/socket.h>
......@@ -280,25 +282,71 @@ gdm_address_is_loopback (GdmAddress *address)
return FALSE;
}
const GList *
gdm_address_peek_local_list (void)
static void
add_local_siocgifconf (GList **list)
{
static GList *the_list = NULL;
static time_t last_time = 0;
char hostbuf[BUFSIZ];
struct addrinfo *result;
struct addrinfo *res;
struct ifconf ifc;
struct ifreq ifreq;
struct ifreq *ifr;
struct ifreq *the_end;
int sock;
char buf[BUFSIZ];
if ((sock = socket (PF_INET, SOCK_DGRAM, 0)) < 0) {
perror ("socket");
return;
}
/* Don't check more then every 5 seconds */
if (last_time + 5 > time (NULL)) {
return the_list;
ifc.ifc_len = sizeof (buf);
ifc.ifc_buf = buf;
if (ioctl (sock, SIOCGIFCONF, (char *) &ifc) < 0) {
perror ("SIOCGIFCONF");
close (sock);
return;
}
g_list_foreach (the_list, (GFunc)gdm_address_free, NULL);
g_list_free (the_list);
the_list = NULL;
/* Get IP address of each active IP network interface. */
the_end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len);
for (ifr = ifc.ifc_req; ifr < the_end; ifr++) {
if (ifr->ifr_addr.sa_family == AF_INET) {
/* IP net interface */
ifreq = *ifr;
if (ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0) {
perror("SIOCGIFFLAGS");
} else if (ifreq.ifr_flags & IFF_UP) { /* active interface */
if (ioctl (sock, SIOCGIFADDR, (char *) &ifreq) < 0) {
perror("SIOCGIFADDR");
} else {
GdmAddress *address;
address = gdm_address_new_from_sockaddr ((struct sockaddr *)&ifreq.ifr_addr,
sizeof (struct sockaddr));
gdm_address_debug (address);
*list = g_list_append (*list, address);
}
}
}
/* Support for variable-length addresses. */
#ifdef HAS_SA_LEN
ifr = (struct ifreq *) ((caddr_t) ifr
+ ifr->ifr_addr.sa_len - sizeof(struct sockaddr));
#endif
}
last_time = time (NULL);
close (sock);
}
static void
add_local_addrinfo (GList **list)
{
char hostbuf[BUFSIZ];
struct addrinfo *result;
struct addrinfo *res;
struct addrinfo hints;
hostbuf[BUFSIZ-1] = '\0';
if (gethostname (hostbuf, BUFSIZ-1) != 0) {
......@@ -306,26 +354,58 @@ gdm_address_peek_local_list (void)
snprintf (hostbuf, BUFSIZ-1, "localhost");
}
memset (&hints, 0, sizeof (hints));
hints.ai_family = AF_UNSPEC;
hints.ai_flags = AI_CANONNAME;
g_debug ("GdmAddress: looking up hostname: %s", hostbuf);
result = NULL;
if (getaddrinfo (hostbuf, NULL, NULL, &result) != 0) {
if (getaddrinfo (hostbuf, NULL, &hints, &result) != 0) {
g_debug ("%s: Could not get address from hostname!", "gdm_peek_local_address_list");
return NULL;
return;
}
for (res = result; res != NULL; res = res->ai_next) {
GdmAddress *address;
g_debug ("family=%d sock_type=%d protocol=%d flags=0x%x canonname=%s\n",
res->ai_family,
res->ai_socktype,
res->ai_protocol,
res->ai_flags,
res->ai_canonname);
address = gdm_address_new_from_sockaddr (res->ai_addr, res->ai_addrlen);
the_list = g_list_append (the_list, address);
*list = g_list_append (*list, address);
}
if (result != NULL) {
freeaddrinfo (result);
result = NULL;
}
}
const GList *
gdm_address_peek_local_list (void)
{
static GList *list = NULL;
static time_t last_time = 0;
/* Don't check more then every 5 seconds */
if (last_time + 5 > time (NULL)) {
return list;
}
g_list_foreach (list, (GFunc)gdm_address_free, NULL);
g_list_free (list);
list = NULL;
last_time = time (NULL);
add_local_siocgifconf (&list);
add_local_addrinfo (&list);
return the_list;
return list;
}
gboolean
......
......@@ -32,9 +32,11 @@ BUILT_SOURCES = \
gdm-simple-slave-glue.h \
gdm-factory-slave-glue.h \
gdm-product-slave-glue.h \
gdm-xdmcp-chooser-slave-glue.h \
gdm-manager-glue.h \
gdm-display-glue.h \
gdm-xdmcp-display-glue.h \
gdm-xdmcp-greeter-display-glue.h \
gdm-xdmcp-chooser-display-glue.h \
gdm-static-display-glue.h \
gdm-transient-display-glue.h \
gdm-local-display-factory-glue.h \
......@@ -52,10 +54,14 @@ gdm-factory-slave-glue.h: gdm-factory-slave.xml Makefile.am
dbus-binding-tool --prefix=gdm_factory_slave --mode=glib-server --output=gdm-factory-slave-glue.h $(srcdir)/gdm-factory-slave.xml
gdm-product-slave-glue.h: gdm-product-slave.xml Makefile.am
dbus-binding-tool --prefix=gdm_product_slave --mode=glib-server --output=gdm-product-slave-glue.h $(srcdir)/gdm-product-slave.xml
gdm-xdmcp-chooser-slave-glue.h: gdm-xdmcp-chooser-slave.xml Makefile.am
dbus-binding-tool --prefix=gdm_xdmcp_chooser_slave --mode=glib-server --output=gdm-xdmcp-chooser-slave-glue.h $(srcdir)/gdm-xdmcp-chooser-slave.xml
gdm-display-glue.h: gdm-display.xml Makefile.am
dbus-binding-tool --prefix=gdm_display --mode=glib-server --output=gdm-display-glue.h $(srcdir)/gdm-display.xml
gdm-xdmcp-display-glue.h: gdm-xdmcp-display.xml Makefile.am
dbus-binding-tool --prefix=gdm_xdmcp_display --mode=glib-server --output=gdm-xdmcp-display-glue.h $(srcdir)/gdm-xdmcp-display.xml
gdm-xdmcp-greeter-display-glue.h: gdm-xdmcp-greeter-display.xml Makefile.am
dbus-binding-tool --prefix=gdm_xdmcp_greeter_display --mode=glib-server --output=gdm-xdmcp-greeter-display-glue.h $(srcdir)/gdm-xdmcp-greeter-display.xml
gdm-xdmcp-chooser-display-glue.h: gdm-xdmcp-chooser-display.xml Makefile.am
dbus-binding-tool --prefix=gdm_xdmcp_chooser_display --mode=glib-server --output=gdm-xdmcp-chooser-display-glue.h $(srcdir)/gdm-xdmcp-chooser-display.xml
gdm-static-display-glue.h: gdm-static-display.xml Makefile.am
dbus-binding-tool --prefix=gdm_static_display --mode=glib-server --output=gdm-static-display-glue.h $(srcdir)/gdm-static-display.xml
gdm-transient-display-glue.h: gdm-transient-display.xml Makefile.am
......@@ -106,6 +112,7 @@ libexec_PROGRAMS = \
gdm-simple-slave \
gdm-factory-slave \
gdm-product-slave \
gdm-xdmcp-chooser-slave \
gdm-session-worker \
$(NULL)
......@@ -208,6 +215,25 @@ gdm_product_slave_LDADD = \
$(top_builddir)/common/libgdmcommon.la \
$(NULL)
gdm_xdmcp_chooser_slave_SOURCES = \
xdmcp-chooser-slave-main.c \
gdm-chooser-server.c \
gdm-chooser-server.h \
gdm-chooser-session.c \
gdm-chooser-session.h \
gdm-slave.c \
gdm-slave.h \
gdm-xdmcp-chooser-slave.c \
gdm-xdmcp-chooser-slave.h \
$(NULL)
gdm_xdmcp_chooser_slave_LDADD = \
$(XLIB_LIBS) \
$(DAEMON_LIBS) \
$(EXTRA_DAEMON_LIBS) \
$(top_builddir)/common/libgdmcommon.la \
$(NULL)
gdm_session_worker_SOURCES = \
session-worker-main.c \
gdm-session-worker.h \
......@@ -241,6 +267,10 @@ gdm_binary_SOURCES = \
gdm-display.h \
gdm-xdmcp-display.c \
gdm-xdmcp-display.h \
gdm-xdmcp-greeter-display.c \
gdm-xdmcp-greeter-display.h \
gdm-xdmcp-chooser-display.c \
gdm-xdmcp-chooser-display.h \
gdm-static-display.c \
gdm-static-display.h \
gdm-transient-display.c \
......@@ -309,9 +339,11 @@ EXTRA_DIST = \
gdm-simple-slave.xml \
gdm-factory-slave.xml \
gdm-product-slave.xml \
gdm-xdmcp-chooser-slave.xml \
gdm-manager.xml \
gdm-display.xml \
gdm-xdmcp-display.xml \
gdm-xdmcp-greeter-display.xml \
gdm-xdmcp-chooser-display.xml \
gdm-static-display.xml \
gdm-transient-display.xml \
gdm-local-display-factory.xml \
......
This diff is collapsed.
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 William Jon McCann <jmccann@redhat.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef __GDM_CHOOSER_SERVER_H
#define __GDM_CHOOSER_SERVER_H
#include <glib-object.h>
G_BEGIN_DECLS
#define GDM_TYPE_CHOOSER_SERVER (gdm_chooser_server_get_type ())
#define GDM_CHOOSER_SERVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDM_TYPE_CHOOSER_SERVER, GdmChooserServer))
#define GDM_CHOOSER_SERVER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDM_TYPE_CHOOSER_SERVER, GdmChooserServerClass))
#define GDM_IS_CHOOSER_SERVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDM_TYPE_CHOOSER_SERVER))
#define GDM_IS_CHOOSER_SERVER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDM_TYPE_CHOOSER_SERVER))
#define GDM_CHOOSER_SERVER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDM_TYPE_CHOOSER_SERVER, GdmChooserServerClass))
typedef struct GdmChooserServerPrivate GdmChooserServerPrivate;
typedef struct
{
GObject parent;
GdmChooserServerPrivate *priv;
} GdmChooserServer;
typedef struct
{
GObjectClass parent_class;
void (* hostname_selected) (GdmChooserServer *chooser_server,
const char *hostname);
void (* connected) (GdmChooserServer *chooser_server);
void (* disconnected) (GdmChooserServer *chooser_server);
} GdmChooserServerClass;
GType gdm_chooser_server_get_type (void);
GdmChooserServer * gdm_chooser_server_new (const char *display_id);
gboolean gdm_chooser_server_start (GdmChooserServer *chooser_server);
gboolean gdm_chooser_server_stop (GdmChooserServer *chooser_server);
char * gdm_chooser_server_get_address (GdmChooserServer *chooser_server);
G_END_DECLS
#endif /* __GDM_CHOOSER_SERVER_H */
This diff is collapsed.
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 William Jon McCann <jmccann@redhat.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef __GDM_CHOOSER_SESSION_H
#define __GDM_CHOOSER_SESSION_H
#include <glib-object.h>
G_BEGIN_DECLS
#define GDM_TYPE_CHOOSER_SESSION (gdm_chooser_session_get_type ())
#define GDM_CHOOSER_SESSION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDM_TYPE_CHOOSER_SESSION, GdmChooserSession))
#define GDM_CHOOSER_SESSION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDM_TYPE_CHOOSER_SESSION, GdmChooserSessionClass))
#define GDM_IS_CHOOSER_SESSION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDM_TYPE_CHOOSER_SESSION))
#define GDM_IS_CHOOSER_SESSION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDM_TYPE_CHOOSER_SESSION))
#define GDM_CHOOSER_SESSION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDM_TYPE_CHOOSER_SESSION, GdmChooserSessionClass))
typedef struct GdmChooserSessionPrivate GdmChooserSessionPrivate;
typedef struct
{
GObject parent;
GdmChooserSessionPrivate *priv;
} GdmChooserSession;
typedef struct
{
GObjectClass parent_class;
void (* started) (GdmChooserSession *chooser_session);
void (* stopped) (GdmChooserSession *chooser_session);
void (* exited) (GdmChooserSession *chooser_session,
int exit_code);
void (* died) (GdmChooserSession *chooser_session,
int signal_number);
} GdmChooserSessionClass;
GType gdm_chooser_session_get_type (void);
GdmChooserSession * gdm_chooser_session_new (const char *display_name,
const char *display_device,
const char *display_hostname);
void gdm_chooser_session_set_server_address (GdmChooserSession *chooser_session,
const char *server_address);
gboolean gdm_chooser_session_start (GdmChooserSession *chooser_session);
gboolean gdm_chooser_session_stop (GdmChooserSession *chooser_session);
G_END_DECLS
#endif /* __GDM_CHOOSER_SESSION_H */
......@@ -47,25 +47,25 @@ static guint32 display_serial = 1;
struct GdmDisplayPrivate
{
char *id;
char *seat_id;
char *id;
char *seat_id;
char *remote_hostname;
int x11_display_number;
char *x11_display_name;
int status;
time_t creation_time;
char *slave_command;
char *remote_hostname;
int x11_display_number;
char *x11_display_name;
int status;
time_t creation_time;
char *slave_command;
char *x11_cookie;
gsize x11_cookie_size;
GdmDisplayAccessFile *access_file;
gboolean is_local;
guint finish_idle_id;
gboolean is_local;
guint finish_idle_id;
GdmSlaveProxy *slave_proxy;
DBusGConnection *connection;
GdmSlaveProxy *slave_proxy;
DBusGConnection *connection;
GdmDisplayAccessFile *user_access_file;
};
......@@ -262,6 +262,33 @@ gdm_display_add_user_authorization (GdmDisplay *display,
return ret;
}
static gboolean
gdm_display_real_set_slave_bus_name (GdmDisplay *display,
const char *name,
GError **error)
{
return TRUE;
}
gboolean
gdm_display_set_slave_bus_name (GdmDisplay *display,
const char *name,
GError **error)
{
gboolean ret;
g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
g_debug ("Setting slave bus name:%s on display %s", name, display->priv->x11_display_name);
g_object_ref (display);
ret = GDM_DISPLAY_GET_CLASS (display)->set_slave_bus_name (display, name, error);
g_object_unref (display);
return ret;
}
static gboolean
gdm_display_real_remove_user_authorization (GdmDisplay *display,
const char *username,
......@@ -802,6 +829,7 @@ gdm_display_class_init (GdmDisplayClass *klass)
klass->create_authority = gdm_display_real_create_authority;
klass->add_user_authorization = gdm_display_real_add_user_authorization;
klass->remove_user_authorization = gdm_display_real_remove_user_authorization;
klass->set_slave_bus_name = gdm_display_real_set_slave_bus_name;
klass->manage = gdm_display_real_manage;
klass->finish = gdm_display_real_finish;
klass->unmanage = gdm_display_real_unmanage;
......
......@@ -61,10 +61,12 @@ typedef struct
gboolean (*remove_user_authorization) (GdmDisplay *display,
const char *username,
GError **error);
gboolean (*set_slave_bus_name) (GdmDisplay *display,
const char *name,
GError **error);
gboolean (*manage) (GdmDisplay *display);
gboolean (*finish) (GdmDisplay *display);
gboolean (*unmanage) (GdmDisplay *display);
} GdmDisplayClass;
typedef enum
......@@ -123,6 +125,9 @@ gboolean gdm_display_add_user_authorization (GdmDisplay *disp
gboolean gdm_display_remove_user_authorization (GdmDisplay *display,
const char *username,
GError **error);
gboolean gdm_display_set_slave_bus_name (GdmDisplay *display,
const char *name,
GError **error);
G_END_DECLS
......
......@@ -32,5 +32,8 @@
<method name="RemoveUserAuthorization">
<arg name="username" direction="in" type="s"/>
</method>
<method name="SetSlaveBusName">
<arg name="name" direction="in" type="s"/>
</method>
</interface>
</node>
......@@ -67,8 +67,6 @@ struct GdmFactorySlavePrivate
{
char *id;
GPid pid;
guint output_watch_id;
guint error_watch_id;
guint greeter_reset_id;
GPid server_pid;
......
......@@ -56,9 +56,6 @@ struct GdmGreeterServerPrivate
char *group_name;
char *display_id;
gboolean interrupted;
gboolean always_restart_greeter;
DBusServer *server;
char *server_address;
DBusConnection *greeter_connection;
......
......@@ -71,11 +71,6 @@ struct GdmGreeterSessionPrivate
CkConnector *ckc;
int user_max_filesize;
gboolean interrupted;
gboolean always_restart_greeter;
guint child_watch_id;
GPid dbus_pid;
......@@ -1030,7 +1025,6 @@ gdm_greeter_session_init (GdmGreeterSession *greeter_session)
greeter_session->priv->pid = -1;
greeter_session->priv->command = g_strdup (LIBEXECDIR "/gdm-simple-greeter");
greeter_session->priv->user_max_filesize = 65536;
}
static void
......
......@@ -66,8 +66,6 @@ struct GdmProductSlavePrivate
{
char *id;
GPid pid;
guint output_watch_id;
guint error_watch_id;
char *relay_address;
......
......@@ -62,8 +62,6 @@ struct GdmSimpleSlavePrivate
{
char *id;
GPid pid;
guint output_watch_id;
guint error_watch_id;
guint greeter_reset_id;
guint start_session_id;
......
......@@ -416,6 +416,35 @@ display_proxy_destroyed_cb (DBusGProxy *display_proxy,
slave->priv->display_proxy = NULL;
}
static gboolean
gdm_slave_set_slave_bus_name (GdmSlave *slave)
{
gboolean res;
GError *error;
const char *name;
name = dbus_bus_get_unique_name (dbus_g_connection_get_connection (slave->priv->connection));
error = NULL;
res = dbus_g_proxy_call (slave->priv->display_proxy,
"SetSlaveBusName",
&error,
G_TYPE_STRING, name,
G_TYPE_INVALID,
G_TYPE_INVALID);
if (! res) {
if (error != NULL) {
g_warning ("Failed to set slave bus name on parent: %s", error->message);
g_error_free (error);
} else {
g_warning ("Failed to set slave bus name on parent");
}
}
return res;
}
static gboolean
gdm_slave_real_start (GdmSlave *slave)
{
......@@ -475,6 +504,8 @@ gdm_slave_real_start (GdmSlave *slave)
exit (1);
}
gdm_slave_set_slave_bus_name (slave);
/* cache some values up front */
error = NULL;
res = dbus_g_proxy_call (slave->priv->display_proxy,
......@@ -1123,7 +1154,7 @@ gdm_slave_get_property (GObject *object,
static gboolean
register_slave (GdmSlave *slave)
{
GError *error = NULL;
GError *error;