+2007-07-26 Havoc Pennington <hp@redhat.com>
+
+ * bus/config-parser-trivial.c (check_return_values): disable a
+ test that hardcoded the bus user's name
+
+ * bus/dispatch.c (bus_dispatch_test_conf): remove the "if
+ (!use_launcher)" around the tests, they were only failing because
+ we didn't pass through all the expected errors from the helper.
+
+ * bus/activation-exit-codes.h
+ (BUS_SPAWN_EXIT_CODE_CHILD_SIGNALED): add a code for child segfaulting
+ (BUS_SPAWN_EXIT_CODE_GENERIC_FAILURE): make "1" be a generic
+ failure code, so if a third party launch helper were written it
+ could just always return 1 on failure.
+
2007-07-24 Daniel P. Berrange <dan@berrange.com>
* bus/dbus-daemon.1: Add docs on new syntax options for the bus
#ifndef BUS_ACTIVATION_EXIT_CODES_H
#define BUS_ACTIVATION_EXIT_CODES_H
-/** Return codes from the launch helper - not public API */
-#define BUS_SPAWN_EXIT_CODE_NO_MEMORY 1
-#define BUS_SPAWN_EXIT_CODE_CONFIG_INVALID 2
-#define BUS_SPAWN_EXIT_CODE_SETUP_FAILED 3
-#define BUS_SPAWN_EXIT_CODE_NAME_INVALID 4
-#define BUS_SPAWN_EXIT_CODE_SERVICE_NOT_FOUND 5
-#define BUS_SPAWN_EXIT_CODE_PERMISSIONS_INVALID 6
-#define BUS_SPAWN_EXIT_CODE_FILE_INVALID 7
-#define BUS_SPAWN_EXIT_CODE_EXEC_FAILED 8
-#define BUS_SPAWN_EXIT_CODE_INVALID_ARGS 9
+/** Return codes from the launch helper - not public API. However,
+ * presumably if some third party did write their own launch helper,
+ * they would have to rely on these, or at least always return
+ * 1 for GENERIC_FAILURE.
+ */
+#define BUS_SPAWN_EXIT_CODE_GENERIC_FAILURE 1
+#define BUS_SPAWN_EXIT_CODE_NO_MEMORY 2
+#define BUS_SPAWN_EXIT_CODE_CONFIG_INVALID 3
+#define BUS_SPAWN_EXIT_CODE_SETUP_FAILED 4
+#define BUS_SPAWN_EXIT_CODE_NAME_INVALID 5
+#define BUS_SPAWN_EXIT_CODE_SERVICE_NOT_FOUND 6
+#define BUS_SPAWN_EXIT_CODE_PERMISSIONS_INVALID 7
+#define BUS_SPAWN_EXIT_CODE_FILE_INVALID 8
+#define BUS_SPAWN_EXIT_CODE_EXEC_FAILED 9
+#define BUS_SPAWN_EXIT_CODE_INVALID_ARGS 10
+#define BUS_SPAWN_EXIT_CODE_CHILD_SIGNALED 11
#endif /* BUS_ACTIVATION_EXIT_CODES_H */
if (dbus_error_has_name (error, DBUS_ERROR_INVALID_ARGS))
return BUS_SPAWN_EXIT_CODE_INVALID_ARGS;
+
+ if (dbus_error_has_name (error, DBUS_ERROR_SPAWN_CHILD_SIGNALED))
+ return BUS_SPAWN_EXIT_CODE_CHILD_SIGNALED;
/* should we assert? */
fprintf(stderr, "%s: %s\n", error->name, error->message);
dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
"Invalid arguments to command line");
break;
+ case BUS_SPAWN_EXIT_CODE_CHILD_SIGNALED:
+ dbus_set_error (error, DBUS_ERROR_SPAWN_CHILD_SIGNALED,
+ "Launched child was signaled, it probably crashed");
+ break;
default:
dbus_set_error (error, DBUS_ERROR_SPAWN_CHILD_EXITED,
"Launch helper exited with unknown return code %i", exit_code);
_dbus_warn ("User was NULL!\n");
goto finish;
}
+#if 0
+ /* the username can be configured in configure.in so this test doesn't work */
if (strcmp (user, "dbus") != 0)
{
_dbus_warn ("User was invalid; '%s'!\n", user);
goto finish;
}
- printf (" <user>dbus</user> OKAY!\n");
-
+ printf (" <user>dbus</user> OKAY!\n");
+#endif
+
/* check type return value is okay */
type = bus_config_parser_get_type (parser);
if (type == NULL)
.PP
A special case is using a port number of zero (or omitting the port),
which means to choose an available port selected by the operating
-system. The port number chosen can be with the --print-address command
-line parameter and will be present in other cases where the server
-reports its own address, such as when DBUS_SESSION_BUS_ADDRESS is set.
+system. The port number chosen can be obtained with the
+--print-address command line parameter and will be present in other
+cases where the server reports its own address, such as when
+DBUS_SESSION_BUS_ADDRESS is set.
.PP
Example: <listen>tcp:host=localhost,port=0</listen>
if (!check_get_connection_unix_process_id (context, baz))
_dbus_assert_not_reached ("GetConnectionUnixProcessID message failed");
- /* Do not do the ListServices test - FIXME: the launcher does not work in this instance */
- if (!use_launcher)
- if (!check_list_services (context, baz))
- _dbus_assert_not_reached ("ListActivatableNames message failed");
+ if (!check_list_services (context, baz))
+ _dbus_assert_not_reached ("ListActivatableNames message failed");
if (!check_no_leftovers (context))
{
#ifdef DBUS_WIN_FIXME
_dbus_warn("TODO: dispatch.c segfault_service_no_auto_start test\n");
#else
- /* only do the segfault test if we are not using the launcher */
- if (!use_launcher)
- check2_try_iterations (context, foo, "segfault_service_no_auto_start",
- check_segfault_service_no_auto_start);
+ check2_try_iterations (context, foo, "segfault_service_no_auto_start",
+ check_segfault_service_no_auto_start);
#endif
check2_try_iterations (context, foo, "existent_service_no_auto_start",
_dbus_warn("TODO: dispatch.c segfault_service_auto_start test\n");
#else
/* only do the segfault test if we are not using the launcher */
- if (!use_launcher)
- check2_try_iterations (context, foo, "segfault_service_auto_start",
- check_segfault_service_auto_start);
+ check2_try_iterations (context, foo, "segfault_service_auto_start",
+ check_segfault_service_auto_start);
#endif
/* only do the shell fail test if we are not using the launcher */
check_existent_service_auto_start);
#endif
- /* only valid for non-launcher */
- if (!use_launcher)
- if (!check_existent_service_auto_start (context, foo))
- _dbus_assert_not_reached ("existent service auto start failed");
+ if (!check_existent_service_auto_start (context, foo))
+ _dbus_assert_not_reached ("existent service auto start failed");
- /* only valid for non-launcher */
- if (!use_launcher)
- if (!check_shell_service_success_auto_start (context, foo))
- _dbus_assert_not_reached ("shell success service auto start failed");
+ if (!check_shell_service_success_auto_start (context, foo))
+ _dbus_assert_not_reached ("shell success service auto start failed");
_dbus_verbose ("Disconnecting foo, bar, and baz\n");
}
static dbus_bool_t
-match_name_owner_changed_signal (DBusConnection *conn, const char *bus_name, const char *lost_name, const char *acquired_name)
+match_name_owner_changed_signal (DBusConnection *conn,
+ const char *bus_name,
+ const char *lost_name,
+ const char *acquired_name)
{
int tries;
DBusMessage *msg;
if (tries == NUM_TRIES_TIL_FAIL)
{
- fprintf (stderr, "Did not recive the expected NameOwnerChanged signal!!!\n");
+ fprintf (stderr, "Did not receive the expected NameOwnerChanged signal, bus_name %s lost_name %s acquired_name %s\n",
+ bus_name ? bus_name : "(null)",
+ lost_name ? lost_name : "(null)",
+ acquired_name ? acquired_name : "(null)");
return FALSE;
}