Hello community, here is the log from the commit of package dbus-1 checked in at Sun Mar 18 06:46:34 CET 2007. -------- --- dbus-1/dbus-1.changes 2007-02-25 14:54:21.000000000 +0100 +++ /mounts/work_src_done/STABLE/dbus-1/dbus-1.changes 2007-03-16 18:09:06.000000000 +0100 @@ -1,0 +2,5 @@ +Fri Mar 16 18:08:35 CET 2007 - dmueller@suse.de + +- display error messages from dbus-launch + +------------------------------------------------------------------- New: ---- dbus-display-errors-from-dbus-launch.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ dbus-1.spec ++++++ --- /var/tmp/diff_new_pack.W29855/_old 2007-03-18 06:46:11.000000000 +0100 +++ /var/tmp/diff_new_pack.W29855/_new 2007-03-18 06:46:11.000000000 +0100 @@ -18,12 +18,13 @@ # COMMON1-BEGIN BuildRequires: doxygen expat libxml2-devel libzio pkgconfig Version: 1.0.2 -Release: 11 +Release: 14 Autoreqprov: on Source0: dbus-%{version}.tar.gz Source1: rc.boot.dbus Source2: dbus-1.desktop Patch0: dbus-do-not-abort-on-check-thoenig-01.patch +Patch1: dbus-display-errors-from-dbus-launch.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # COMMON1-END Prereq: /usr/sbin/groupadd /usr/sbin/useradd /sbin/insserv /etc/init.d/boot.localfs @@ -126,6 +127,7 @@ %setup -n dbus-%{version} -q # Disable this until we hit RC phase #%patch0 +%patch1 %build autoreconf -fi @@ -231,6 +233,8 @@ %{_datadir}/susehelp %changelog +* Fri Mar 16 2007 - dmueller@suse.de +- display error messages from dbus-launch * Sun Feb 25 2007 - thoenig@suse.de - remove leading whitespace from .changes * Thu Feb 22 2007 - thoenig@suse.de ++++++ dbus-1-x11.spec ++++++ --- /var/tmp/diff_new_pack.W29855/_old 2007-03-18 06:46:11.000000000 +0100 +++ /var/tmp/diff_new_pack.W29855/_new 2007-03-18 06:46:11.000000000 +0100 @@ -20,12 +20,13 @@ # COMMON1-BEGIN BuildRequires: doxygen expat libxml2-devel libzio pkgconfig Version: 1.0.2 -Release: 11 +Release: 14 Autoreqprov: on Source0: dbus-%{version}.tar.gz Source1: rc.boot.dbus Source2: dbus-1.desktop Patch0: dbus-do-not-abort-on-check-thoenig-01.patch +Patch1: dbus-display-errors-from-dbus-launch.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # COMMON1-END # COMMON1-END @@ -59,6 +60,7 @@ %setup -n dbus-%{version} -q # Disable this until we hit RC phase #%patch0 +%patch1 %build autoreconf -fi ++++++ dbus-display-errors-from-dbus-launch.diff ++++++ ? test/name-test/Makefile.in Index: dbus/dbus-sysdeps-unix.c =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-sysdeps-unix.c,v retrieving revision 1.18 diff -u -p -B -b -r1.18 dbus-sysdeps-unix.c --- dbus/dbus-sysdeps-unix.c 1 Jan 2007 21:29:59 -0000 1.18 +++ dbus/dbus-sysdeps-unix.c 13 Feb 2007 18:41:40 -0000 @@ -2434,8 +2434,9 @@ dbus_bool_t _dbus_get_autolaunch_address (DBusString *address, DBusError *error) { - static char *argv[5]; - int address_pipe[2]; + static char *argv[6]; + int address_pipe[2] = { -1, -1 }; + int errors_pipe[2] = { -1, -1 }; pid_t pid; int ret; int status; @@ -2464,6 +2465,8 @@ _dbus_get_autolaunch_address (DBusString ++i; argv[i] = "--binary-syntax"; ++i; + argv[i] = "--close-stderr"; + ++i; argv[i] = NULL; ++i; @@ -2482,6 +2485,15 @@ _dbus_get_autolaunch_address (DBusString _dbus_strerror (errno)); goto out; } + if (pipe (errors_pipe) < 0) + { + dbus_set_error (error, _dbus_error_from_errno (errno), + "Failed to create a pipe: %s", + _dbus_strerror (errno)); + _dbus_verbose ("Failed to create a pipe to call dbus-launch: %s\n", + _dbus_strerror (errno)); + goto out; + } pid = fork (); if (pid < 0) @@ -2504,6 +2516,7 @@ _dbus_get_autolaunch_address (DBusString /* set-up stdXXX */ close (address_pipe[READ_END]); + close (errors_pipe[READ_END]); close (0); /* close stdin */ close (1); /* close stdout */ close (2); /* close stderr */ @@ -2512,11 +2525,12 @@ _dbus_get_autolaunch_address (DBusString _exit (1); if (dup2 (address_pipe[WRITE_END], 1) == -1) _exit (1); - if (dup2 (fd, 2) == -1) + if (dup2 (errors_pipe[WRITE_END], 2) == -1) _exit (1); close (fd); close (address_pipe[WRITE_END]); + close (errors_pipe[WRITE_END]); execv (DBUS_BINDIR "/dbus-launch", argv); @@ -2529,6 +2543,10 @@ _dbus_get_autolaunch_address (DBusString /* parent process */ close (address_pipe[WRITE_END]); + close (errors_pipe[WRITE_END]); + address_pipe[WRITE_END] = -1; + errors_pipe[WRITE_END] = -1; + ret = 0; do { @@ -2549,7 +2567,21 @@ _dbus_get_autolaunch_address (DBusString _dbus_string_get_length (address) == orig_len) { /* The process ended with error */ + DBusString error_message; + _dbus_string_init (&error_message); + ret = 0; + do + { + ret = _dbus_read (errors_pipe[READ_END], &error_message, 1024); + } + while (ret > 0); + _dbus_string_set_length (address, orig_len); + if (_dbus_string_get_length (&error_message) > 0) + dbus_set_error (error, DBUS_ERROR_SPAWN_EXEC_FAILED, + "dbus-launch failed to autolaunch D-Bus session: %s", + _dbus_string_get_data (&error_message)); + else dbus_set_error (error, DBUS_ERROR_SPAWN_EXEC_FAILED, "Failed to execute dbus-launch to autolaunch D-Bus session"); goto out; @@ -2563,6 +2595,15 @@ _dbus_get_autolaunch_address (DBusString else _DBUS_ASSERT_ERROR_IS_SET (error); + if (address_pipe[0] != -1) + close (address_pipe[0]); + if (address_pipe[1] != -1) + close (address_pipe[1]); + if (errors_pipe[0] != -1) + close (errors_pipe[0]); + if (errors_pipe[1] != -1) + close (errors_pipe[1]); + _dbus_string_free (&uuid); return retval; } Index: tools/dbus-launch.c =================================================================== RCS file: /cvs/dbus/dbus/tools/dbus-launch.c,v retrieving revision 1.21 diff -u -p -B -b -r1.21 dbus-launch.c --- tools/dbus-launch.c 26 Oct 2006 15:55:44 -0000 1.21 +++ tools/dbus-launch.c 13 Feb 2007 18:41:40 -0000 @@ -596,6 +596,27 @@ babysit (int exit_with_session, exit (0); } +static void do_close_stderr (void) +{ + fflush (stderr); + + /* dbus-launch is a Unix-only program, so we can rely on /dev/null being there. + * We're including unistd.h and we're dealing with sh/csh launch sequences... + */ + int fd = open ("/dev/null", O_RDWR); + if (fd == -1) + { + fprintf (stderr, "Internal error: cannot open /dev/null: %s", strerror (errno)); + exit (1); + } + + close (2); + if (dup2 (fd, 2) == -1) + // error; we can't report an error anymore... + exit (1); + close (fd); +} + #define READ_END 0 #define WRITE_END 1 @@ -613,6 +634,7 @@ main (int argc, char **argv) int auto_shell_syntax = FALSE; int autolaunch = FALSE; int requires_arg = FALSE; + int close_stderr = FALSE; int i; int ret; int bus_pid_to_launcher_pipe[2]; @@ -647,6 +669,8 @@ main (int argc, char **argv) version (); else if (strcmp (arg, "--exit-with-session") == 0) exit_with_session = TRUE; + else if (strcmp (arg, "--close-stderr") == 0) + close_stderr = TRUE; else if (strstr (arg, "--autolaunch=") == arg) { const char *s; @@ -837,6 +861,9 @@ main (int argc, char **argv) char write_pid_fd_as_string[MAX_FD_LEN]; char write_address_fd_as_string[MAX_FD_LEN]; + if (close_stderr) + do_close_stderr (); + verbose ("=== Babysitter's intermediate parent created\n"); /* Fork once more to create babysitter */ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org