head 1.7; access; symbols pkgsrc-2019Q2:1.6.0.88 pkgsrc-2019Q2-base:1.6 pkgsrc-2019Q1:1.6.0.86 pkgsrc-2019Q1-base:1.6 pkgsrc-2018Q4:1.6.0.84 pkgsrc-2018Q4-base:1.6 pkgsrc-2018Q3:1.6.0.82 pkgsrc-2018Q3-base:1.6 pkgsrc-2018Q2:1.6.0.80 pkgsrc-2018Q2-base:1.6 pkgsrc-2018Q1:1.6.0.78 pkgsrc-2018Q1-base:1.6 pkgsrc-2017Q4:1.6.0.76 pkgsrc-2017Q4-base:1.6 pkgsrc-2017Q3:1.6.0.74 pkgsrc-2017Q3-base:1.6 pkgsrc-2017Q2:1.6.0.70 pkgsrc-2017Q2-base:1.6 pkgsrc-2017Q1:1.6.0.68 pkgsrc-2017Q1-base:1.6 pkgsrc-2016Q4:1.6.0.66 pkgsrc-2016Q4-base:1.6 pkgsrc-2016Q3:1.6.0.64 pkgsrc-2016Q3-base:1.6 pkgsrc-2016Q2:1.6.0.62 pkgsrc-2016Q2-base:1.6 pkgsrc-2016Q1:1.6.0.60 pkgsrc-2016Q1-base:1.6 pkgsrc-2015Q4:1.6.0.58 pkgsrc-2015Q4-base:1.6 pkgsrc-2015Q3:1.6.0.56 pkgsrc-2015Q3-base:1.6 pkgsrc-2015Q2:1.6.0.54 pkgsrc-2015Q2-base:1.6 pkgsrc-2015Q1:1.6.0.52 pkgsrc-2015Q1-base:1.6 pkgsrc-2014Q4:1.6.0.50 pkgsrc-2014Q4-base:1.6 pkgsrc-2014Q3:1.6.0.48 pkgsrc-2014Q3-base:1.6 pkgsrc-2014Q2:1.6.0.46 pkgsrc-2014Q2-base:1.6 pkgsrc-2014Q1:1.6.0.44 pkgsrc-2014Q1-base:1.6 pkgsrc-2013Q4:1.6.0.42 pkgsrc-2013Q4-base:1.6 pkgsrc-2013Q3:1.6.0.40 pkgsrc-2013Q3-base:1.6 pkgsrc-2013Q2:1.6.0.38 pkgsrc-2013Q2-base:1.6 pkgsrc-2013Q1:1.6.0.36 pkgsrc-2013Q1-base:1.6 pkgsrc-2012Q4:1.6.0.34 pkgsrc-2012Q4-base:1.6 pkgsrc-2012Q3:1.6.0.32 pkgsrc-2012Q3-base:1.6 pkgsrc-2012Q2:1.6.0.30 pkgsrc-2012Q2-base:1.6 pkgsrc-2012Q1:1.6.0.28 pkgsrc-2012Q1-base:1.6 pkgsrc-2011Q4:1.6.0.26 pkgsrc-2011Q4-base:1.6 pkgsrc-2011Q3:1.6.0.24 pkgsrc-2011Q3-base:1.6 pkgsrc-2011Q2:1.6.0.22 pkgsrc-2011Q2-base:1.6 pkgsrc-2011Q1:1.6.0.20 pkgsrc-2011Q1-base:1.6 pkgsrc-2010Q4:1.6.0.18 pkgsrc-2010Q4-base:1.6 pkgsrc-2010Q3:1.6.0.16 pkgsrc-2010Q3-base:1.6 pkgsrc-2010Q2:1.6.0.14 pkgsrc-2010Q2-base:1.6 pkgsrc-2010Q1:1.6.0.12 pkgsrc-2010Q1-base:1.6 pkgsrc-2009Q4:1.6.0.10 pkgsrc-2009Q4-base:1.6 pkgsrc-2009Q3:1.6.0.8 pkgsrc-2009Q3-base:1.6 pkgsrc-2009Q2:1.6.0.6 pkgsrc-2009Q2-base:1.6 pkgsrc-2009Q1:1.6.0.4 pkgsrc-2009Q1-base:1.6 pkgsrc-2008Q4:1.6.0.2 pkgsrc-2008Q4-base:1.6 pkgsrc-2008Q3:1.5.0.14 pkgsrc-2008Q3-base:1.5 cube-native-xorg:1.5.0.12 cube-native-xorg-base:1.5 pkgsrc-2008Q2:1.5.0.10 pkgsrc-2008Q2-base:1.5 pkgsrc-2008Q1:1.5.0.8 pkgsrc-2008Q1-base:1.5 pkgsrc-2007Q4:1.5.0.6 pkgsrc-2007Q4-base:1.5 pkgsrc-2007Q3:1.5.0.4 pkgsrc-2007Q3-base:1.5 pkgsrc-2007Q2:1.5.0.2 pkgsrc-2007Q2-base:1.5 pkgsrc-2007Q1:1.4.0.8 pkgsrc-2007Q1-base:1.4 pkgsrc-2006Q4:1.4.0.6 pkgsrc-2006Q4-base:1.4 pkgsrc-2006Q3:1.4.0.4 pkgsrc-2006Q3-base:1.4 pkgsrc-2006Q2:1.4.0.2 pkgsrc-2006Q2-base:1.4 pkgsrc-2006Q1:1.2.0.8 pkgsrc-2006Q1-base:1.2 pkgsrc-2005Q4:1.2.0.6 pkgsrc-2005Q4-base:1.2 pkgsrc-2005Q3:1.2.0.4 pkgsrc-2005Q3-base:1.2 pkgsrc-2005Q2:1.2.0.2 pkgsrc-2005Q2-base:1.2 pkgsrc-2005Q1:1.1.0.4 pkgsrc-2005Q1-base:1.1 pkgsrc-2004Q4:1.1.0.2 pkgsrc-2004Q4-base:1.1; locks; strict; comment @# @; 1.7 date 2019.09.16.10.53.23; author nia; state dead; branches; next 1.6; commitid 7IAX00xDF9ER2eDB; 1.6 date 2008.10.16.18.17.30; author drochner; state Exp; branches; next 1.5; 1.5 date 2007.04.11.20.25.38; author drochner; state dead; branches; next 1.4; 1.4 date 2006.04.02.11.07.28; author jmmv; state Exp; branches; next 1.3; 1.3 date 2006.04.01.17.36.41; author jmmv; state Exp; branches; next 1.2; 1.2 date 2005.03.22.16.21.26; author jmmv; state dead; branches; next 1.1; 1.1 date 2004.12.08.02.13.39; author taca; state Exp; branches; next ; desc @@ 1.7 log @Remove x11/gnome-session successor x11/mate-session-manager @ text @$NetBSD: patch-ae,v 1.6 2008/10/16 18:17:30 drochner Exp $ --- gnome-session/gsm-autostart-app.c.orig 2008-10-15 19:38:53.000000000 +0200 +++ gnome-session/gsm-autostart-app.c @@@@ -25,6 +25,7 @@@@ #include #include #include +#include #include #include @ 1.6 log @update to 2.24.0 This switches to the gnome-2.24 release branch. @ text @d1 1 a1 1 $NetBSD$ @ 1.5 log @update to 2.18.0 This moves this pkg to the new stable gnome branch, too much to list here. pkgsrc note: automatic dbus startup doesn't work well, it seems to conflict with another dbus autostart. Better start the session with "dbus-launch". gdm-2.18 will take care of that. @ text @d1 1 a1 1 $NetBSD: patch-ae,v 1.4 2006/04/02 11:07:28 jmmv Exp $ d3 6 a8 33 http://bugzilla.gnome.org/show_bug.cgi?id=336237 --- gnome-session/gsm-dbus.c.orig 2006-04-02 12:32:32.000000000 +0200 +++ gnome-session/gsm-dbus.c @@@@ -0,0 +1,359 @@@@ +/* gsm-dbus.c - Handle the dbus-daemon process. + * + * Copyright (c) 2006 Julio M. Merino Vidal + * + * 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, 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. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include +#include d10 3 a12 330 +#include +#include + +#include +#include + +#include "gsm-dbus.h" + +static pid_t dbus_daemon_pid = 0; + +static gboolean have_dbus_daemon (void); +static gboolean have_running_instance (void); +static int read_line (int, char *, ssize_t); +static void start_child (int, int); +static void start_parent (int, int, pid_t); + +/* --------------------------------------------------------------------- + * PUBLIC INTERFACE + * --------------------------------------------------------------------- */ + +/* + * Starts the dbus-daemon if not already running and attaches it to the + * current environment by defining DBUS_SESSION_BUS_ADDRESS. Returns + * true if we launch a new dbus-daemon so that we know if we have to call + * gsm_dbus_daemon_stop later on or not. + * + * This function can only be called if dbus-daemon is not already running + * (i.e., if gnome-session is starting up or if gsm_dbus_daemon_stop was + * previously called). + */ +gboolean +gsm_dbus_daemon_start (void) +{ + int address_pipe[2]; + int pid_pipe[2]; + pid_t tmp_pid; + + g_assert (dbus_daemon_pid == 0); + + if (have_running_instance ()) + return FALSE; + if (! have_dbus_daemon ()) + return FALSE; + + /* + * At this point, dbus-daemon is not running for the current session + * and the binary exists. Spawn it. + */ + + if (pipe (address_pipe) == -1) + { + g_printerr ("Cannot create address pipe for dbus-daemon\n"); + return FALSE; + } + + if (pipe (pid_pipe) == -1) + { + close (address_pipe[0]); + close (address_pipe[1]); + g_printerr ("Cannot create pid pipe for dbus-daemon\n"); + return FALSE; + } + + tmp_pid = fork (); + if (tmp_pid == -1) + { + close (address_pipe[0]); + close (address_pipe[1]); + close (pid_pipe[0]); + close (pid_pipe[1]); + g_printerr ("Cannot create child process for dbus-daemon\n"); + return FALSE; + } + else if (tmp_pid == 0) + { + close (address_pipe[0]); + close (pid_pipe[0]); + start_child (address_pipe[1], pid_pipe[1]); + /* NOTREACHED */ + } + else + { + close (address_pipe[1]); + close (pid_pipe[1]); + start_parent (address_pipe[0], pid_pipe[0], tmp_pid); + } + + g_assert (dbus_daemon_pid != 0); + return TRUE; +} + +/* + * Stops the running dbus-daemon. Can only be called if we own the process; + * i.e., if gsm_dbus_daemon_start returned true. + */ +void +gsm_dbus_daemon_stop (void) +{ + g_assert (dbus_daemon_pid != 0); + + if (kill (dbus_daemon_pid, SIGTERM) == -1) + g_printerr ("Failed to kill dbus-daemon (pid %d)\n", + dbus_daemon_pid); + else + { + dbus_daemon_pid = 0; + g_unsetenv ("DBUS_SESSION_BUS_ADDRESS"); + } +} + +/* --------------------------------------------------------------------- + * PRIVATE FUNCTIONS + * --------------------------------------------------------------------- */ + +/* + * Check whether the dbus-daemon binary is in the path and raise an + * appropriate error message if it is not. + */ +static gboolean +have_dbus_daemon (void) +{ + gboolean result; + gchar *file_name; + + file_name = g_find_program_in_path ("dbus-daemon"); + if (file_name == NULL) + g_printerr ("Cannot locate dbus-daemon\n"); + result = file_name != NULL; + g_free (file_name); + + return result; +} + +/* + * Check whether there is a dbus-daemon session instance currently running + * (not spawned by us). If there is, do nothing and return TRUE. + */ +static gboolean +have_running_instance (void) +{ + const gchar *address_str; + + g_assert (dbus_daemon_pid == 0); + + address_str = g_getenv ("DBUS_SESSION_BUS_ADDRESS"); + return address_str != NULL; +} + +/* + * Reads a single line from the given file descriptor and stores it in the + * buffer pointed to by 'buf'. + * + * After finding the first new line character, the function returns. This + * is to avoid reading dbus' pid multiple times from its file descriptor. + */ +static int +read_line (int fd, char *buf, ssize_t bufsize) +{ + gboolean discard, done; + ssize_t bytes; + + bytes = 0; + discard = FALSE; + done = FALSE; + do + { + ssize_t i, result; + + result = read (fd, &buf[bytes], bufsize - bytes); + if (result < 0) + return -1; + else if (result > 0 && !discard) + { + if (bytes + result < bufsize) + bytes += result; + else + bytes = bufsize - 1; + } + else + done = TRUE; + + for (i = 0; !discard && i < bytes; i++) + if (buf[i] == '\n') + { + buf[i] = '\0'; + discard = TRUE; + } + } + while (!done); + + g_assert (bytes >= 0 && bytes < bufsize); + buf[bytes] = '\0'; + + return bytes; +} + +/* + * Code run by the child process after the fork to launch dbus-demon. + * + * As the child, this execs dbus-daemon, connecting it to the appropriate + * file descriptors. + */ +static void +start_child (int address_fd, int pid_fd) +{ + gchar address_str[16]; + gchar pid_str[16]; + int fd; + long open_max; + + open_max = sysconf (_SC_OPEN_MAX); + for (fd = 0; fd < open_max; fd++) + { + if (fd != STDIN_FILENO && fd != STDOUT_FILENO && fd != STDERR_FILENO && + fd != address_fd && fd != pid_fd) + close (fd); + } + + g_snprintf (address_str, sizeof (address_str), "%d", address_fd); + g_snprintf (pid_str, sizeof (pid_str), "%d", pid_fd); + + execlp ("dbus-daemon", + "dbus-daemon", + "--fork", + "--print-address", address_str, + "--print-pid", pid_str, + "--session", + NULL); + + g_printerr ("Could not launch dbus-daemon\n"); + + exit (EXIT_FAILURE); +} + +/* + * Code run by the parent process after the fork to launch dbus-demon. + * + * As the parent, this waits until dbus-daemon forks itself again and + * fetches its address and pid to later take its ownership. + */ +static void +start_parent (int address_fd, int pid_fd, pid_t child) +{ + char address_str[256]; + char pid_str[256]; + char *tmp_ep; + int exitstat; + unsigned long tmp_num; + ssize_t bytes; + + g_assert (child > 0); + + /* + * dbus-daemon --fork causes our child process to exit prematurely + * because it is not the real daemon. See if it worked correctly + * and clean it up to avoid a zombie. + * + * Life could be much easier if dbus-daemon had a --no-fork flag. + * But, as it hasn't it, we cannot assume that it will not fork, + * because we have no control over its configuration file. + */ + if (waitpid (child, &exitstat, 0) == -1) + { + close (address_fd); + close (pid_fd); + + g_printerr ("Failed to get dbus-daemon status\n"); + return; + } + if (!WIFEXITED (exitstat) || WEXITSTATUS (exitstat) != EXIT_SUCCESS) + { + close (address_fd); + close (pid_fd); + + g_printerr ("dbus-daemon exited unexpectedly\n"); + return; + } + + /* + * Fetch dbus-daemon address. + */ + bytes = read_line (address_fd, address_str, sizeof (address_str)); + if (bytes == -1 || bytes == 0) + { + close (address_fd); + close (pid_fd); + + g_printerr ("Failed to get dbus-daemon's address\n"); + return; + } + + /* + * Fetch dbus-daemon pid. + */ + bytes = read_line (pid_fd, pid_str, sizeof (pid_str)); + if (bytes == -1 || bytes == 0) + { + close (address_fd); + close (pid_fd); + + g_printerr ("Failed to get dbus-daemon's pid\n"); + return; + } + + close (address_fd); + close (pid_fd); + + /* + * Convert the string printed in pid_fd to a pid value. Do the usual + * strtoul dance to check for a valid number. + */ + errno = 0; + tmp_num = strtoul(pid_str, &tmp_ep, 10); + if (pid_str[0] == '\0' || *tmp_ep != '\0') + { + g_printerr ("dbus-daemon pid invalid (not a number)\n"); + return; + } + if (errno == ERANGE && tmp_num == ULONG_MAX) + { + g_printerr ("dbus-daemon pid invalid (out of range)\n"); + return; + } + dbus_daemon_pid = tmp_num; + + /* + * All right! Tell our future children about the new born dbus-daemon. + */ + g_setenv ("DBUS_SESSION_BUS_ADDRESS", address_str, TRUE); +} @ 1.4 log @Fix some issues in gsm-dbus.c as reported by Vincent Untz in bugzilla. Bump PKGREVISION to 2. @ text @d1 1 a1 1 $NetBSD: patch-ae,v 1.3 2006/04/01 17:36:41 jmmv Exp $ @ 1.3 log @Make gnome-session spawn a dbus-daemon for the current session so that things work "out of the box" again: some programs now require dbus to even start up (e.g. epiphany). Bump PKGREVISION to 1. The code comes from GNOME's bug 336237 and I'm adding it to the package so that it can get some testing. @ text @d1 1 a1 1 $NetBSD$ d5 3 a7 3 --- /dev/null 2006-04-01 19:01:40.000000000 +0200 +++ gnome-session/gsm-dbus.c 2006-04-01 19:02:43.000000000 +0200 @@@@ -0,0 +1,356 @@@@ d77 1 a77 1 + return TRUE; d158 1 d164 1 d167 1 a167 1 + return file_name != NULL; d218 1 a218 1 + for (i = 0; i < bytes; i++) d220 4 a223 1 + discard = TRUE; a228 2 + if (bytes > 0 && buf[bytes - 1] == '\n') + buf[bytes - 1] = '\0'; @ 1.2 log @Update to 2.10.0: ============== Version 2.10.0 ============== Misc * New splash screen (Sami "alump" Viitanen) * Improved schemas string (Byran Clark, Kjartan Maraas) Translators * Vladimir \"Kaladan\" Petkov (bg) * Jordi Mallach (ca) * Miloslav Trmac (cs) * Martin Willemoes Hansen (da) * Frank Arnold (de) * Kostas Papadimas (el) * Adam Weinberger (en_CA) * David Lodge (en_GB) * Francisco Javier F. Serrador (es) * Ivar Smolin (et) * Pauli Virtanen (fi) * Christophe Merlet (RedFox) (fr) * Ankit Patel (gu) * Gil Osher (he) * Gabor Kelemen (hu) * Luca Ferretti (it) * Takeshi AIHANA (ja) * Changwoo Ryu (ko) * Žygimantas Beručka (lt) * Kjartan Maraas (nb) * Tino Meinen (nl) * Åsmund Skjæveland (nn) * Kjartan Maraas (no) * GNOME PL Team (pl) * Evandro Fernandes Giovanini (pt_BR) * Duarte Loreto (pt) * Mişu Moldovan (ro) * Leonid Kanter (ru) * Marcel Telka (sk) * Laurent Dhima (sq) * Данило Шеган (sr) * Christian Rose (sv) * Theppitak Karoonboonyanan (th) * Maxim Dziumanenko (uk) * Simon Kemisho (xh) * Wang Jian (zh_CN) * Woodman Tuen (zh_TW) ============= Version 2.9.4 ============= Session Manager * Use GDM's logout actions protocol to shutdown/reboot (Raffaele Sandrini, Mark) * Change "Prompt" to "Ask" in the configuration dialog (Vincent Noel) * Fix compiler warnings (Jens Granseuer) * Slave the lifecycle of the keyring daemon to the session (Alex Larsson) Translators * Jordi Mallach (ca) * Miloslav Trmac (cs) * Adam Weinberger (en_CA) * Francisco Javier F. Serrador (es) * Kjartan Maraas (nb) * Kjartan Maraas (no) * Laurent Dhima (sq) * Christian Rose (sv) * Zuza Software Foundation (zu) ============= Version 2.9.2 ============= Misc * Add X-GNOME-Bugzilla-Version to .desktop file (Christoffer Olsen) * Install .desktop file in $(datadir)/applications (Mark) Translators * Martin Willemoes Hansen (da) * Zuza Software Foundation (nso) @ text @d1 1 a1 1 $NetBSD: patch-ae,v 1.1 2004/12/08 02:13:39 taca Exp $ d3 361 a363 14 --- gnome-session/manager.c.orig Fri Oct 1 19:13:23 2004 +++ gnome-session/manager.c @@@@ -1042,9 +1042,10 @@@@ no_response_warning (gpointer data) if (interact_ping_replied) { + IceConn ice_conn; gsm_verbose ("have interact_list; sending ping with data to client %p\n", client); print_client (client); - IceConn ice_conn = SmsGetIceConnection (client->connection); + ice_conn = SmsGetIceConnection (client->connection); interact_ping_replied = FALSE; IcePing (ice_conn, interact_ping_reply, (IcePointer)client); } @ 1.1 log @Fix compile error on NetBSD 1.6.2, making it compile with gcc-2.95. @ text @d1 1 a1 1 $NetBSD$ @