diff options
Diffstat (limited to 'bus')
-rw-r--r-- | bus/activation-exit-codes.h | 26 | ||||
-rw-r--r-- | bus/activation-helper-bin.c | 3 | ||||
-rw-r--r-- | bus/activation.c | 4 | ||||
-rw-r--r-- | bus/config-parser-trivial.c | 7 | ||||
-rw-r--r-- | bus/dbus-daemon.1.in | 7 | ||||
-rw-r--r-- | bus/dispatch.c | 29 |
6 files changed, 42 insertions, 34 deletions
diff --git a/bus/activation-exit-codes.h b/bus/activation-exit-codes.h index 86a005ce..af6952e9 100644 --- a/bus/activation-exit-codes.h +++ b/bus/activation-exit-codes.h @@ -25,15 +25,21 @@ #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 */ diff --git a/bus/activation-helper-bin.c b/bus/activation-helper-bin.c index 248a86f7..4a359726 100644 --- a/bus/activation-helper-bin.c +++ b/bus/activation-helper-bin.c @@ -58,6 +58,9 @@ convert_error_to_exit_code (DBusError *error) 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); diff --git a/bus/activation.c b/bus/activation.c index d5162ec2..d087d6bd 100644 --- a/bus/activation.c +++ b/bus/activation.c @@ -1159,6 +1159,10 @@ handle_activation_exit_error (int exit_code, 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); diff --git a/bus/config-parser-trivial.c b/bus/config-parser-trivial.c index b825047a..98d554e8 100644 --- a/bus/config-parser-trivial.c +++ b/bus/config-parser-trivial.c @@ -353,13 +353,16 @@ check_return_values (const DBusString *full_path) _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) diff --git a/bus/dbus-daemon.1.in b/bus/dbus-daemon.1.in index 63d97183..e230e513 100644 --- a/bus/dbus-daemon.1.in +++ b/bus/dbus-daemon.1.in @@ -232,9 +232,10 @@ Example: <listen>tcp:host=localhost,port=0,family=ipv4</listen> .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> diff --git a/bus/dispatch.c b/bus/dispatch.c index d434e808..209bde3e 100644 --- a/bus/dispatch.c +++ b/bus/dispatch.c @@ -4516,10 +4516,8 @@ bus_dispatch_test_conf (const DBusString *test_data_dir, 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)) { @@ -4536,10 +4534,8 @@ bus_dispatch_test_conf (const DBusString *test_data_dir, #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", @@ -4553,9 +4549,8 @@ bus_dispatch_test_conf (const DBusString *test_data_dir, _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 */ @@ -4576,15 +4571,11 @@ bus_dispatch_test_conf (const DBusString *test_data_dir, 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"); |