1. 28 Mar, 2019 1 commit
    • Vasily Galkin's avatar
      gdbusaddress, win32: don't rely on short names · 066ce387
      Vasily Galkin authored
      Closes: #1566
      
      Short names were used in win32 implementation to allow launching
      on installations where full path to libgio-2.0-0.dll contain spaces.
      However, short names are optional on windows: so if they were disabled
      that method fails - see issue linked above.
      
      Since rundll32 doesn't support neither spaces, nor quotes in cmdline
      this patch changes rundll32 argument to just .\gio-dll-name.dll
      and uses the entire path directory containing gio dll as rundll32
      current directory.
      
      Added comments informing about potential subtleties discovered during
      writing test for gdbusaddress on win32.
      There are not known to have real-world user-visible effect,
      so by now I'm only adding comments without creating issues.
      066ce387
  2. 13 Jun, 2018 1 commit
    • Will Thompson's avatar
      g_dbus_is_supported_address(): set error if returning FALSE · ba7b035f
      Will Thompson authored
      Previously, calling:
      
          g_dbus_is_supported_address ("some-imaginary-transport:", NULL)
      
      correctly returned FALSE; but calling:
      
          g_dbus_is_supported_address ("some-imaginary-transport:", &error)
      
      crashed with:
      
          GLib-GIO:ERROR:../gio/gdbusaddress.c:434:g_dbus_is_supported_address:
          assertion failed: (ret || (!ret && (error == NULL || *error != NULL)))
      
      This was because, if the address component did not start with a known
      transport, no error was set. Fix this, reusing an error string used by
      the corresponding else branch in g_dbus_address_connect(), and adjust
      the test to pass both NULL and non-NULL GError **s to this function in
      every test case. This case:
      
          g_assert (!g_dbus_is_supported_address ("some-imaginary-transport:foo=bar;unix:path=/this/is/valid", NULL));
      
      would have caught this bug with a non-NULL GError **.
      ba7b035f
  3. 31 Jan, 2018 1 commit
  4. 07 Nov, 2017 1 commit
  5. 03 Aug, 2017 1 commit
    • Philip Withnall's avatar
      Consistently save errno immediately after the operation setting it · 5cddde1f
      Philip Withnall authored
      Prevent the situation where errno is set by function A, then function B
      is called (which is typically _(), but could be anything else) and it
      overwrites errno, then errno is checked by the caller.
      
      errno is a horrific API, and we need to be careful to save its value as
      soon as a function call (which might set it) returns. i.e. Follow the
      pattern:
        int errsv, ret;
        ret = some_call_which_might_set_errno ();
        errsv = errno;
      
        if (ret < 0)
          puts (strerror (errsv));
      
      This patch implements that pattern throughout GLib. There might be a few
      places in the test code which still use errno directly. They should be
      ported as necessary. It doesn’t modify all the call sites like this:
        if (some_call_which_might_set_errno () && errno == ESOMETHING)
      since the refactoring involved is probably more harmful than beneficial
      there. It does, however, refactor other call sites regardless of whether
      they were originally buggy.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=785577
      5cddde1f
  6. 29 May, 2017 1 commit
  7. 08 Feb, 2017 2 commits
  8. 29 Nov, 2016 1 commit
  9. 22 Nov, 2016 1 commit
  10. 12 Oct, 2016 1 commit
  11. 17 Jul, 2016 1 commit
    • Simon McVittie's avatar
      Do not attempt to autolaunch a session dbus-daemon with no DISPLAY · 0f2e4fd0
      Simon McVittie authored
      The two known use-cases for autolaunching are:
      
      * X-forwarding: "ssh -Y myhost myapp" resulting in a
        session bus on myhost but an X server on the original host
      
      * Legacy desktop environments on OSs without D-Bus integration:
        e.g. running a single GNOME or KDE app under fvwm or something,
        without a session dbus-daemon being started by either systemd,
        gnome-session, or OS integration scripts analogous to Debian's
        /etc/X11/Xsession.d/75dbus_dbus-launch
      
      In either case, an X11 DISPLAY is also needed.
      
      "dbus-launch --autolaunch" doesn't do anything useful when unable
      to connect to an X11 display; this has been the case since the feature
      was added in 2006, and is useful to avoid "split brain" situations in
      which two processes that ought to be part of the same session end up
      on separate session buses. Since dbus commit 407c111 in 2011,
      libdbus hasn't even attempted to run "dbus-launch --autolaunch"
      unless getenv("DISPLAY") returns non-null in the parent: this avoids
      doing a relatively complicated fork-and-exec that is clearly not
      going to lead to success. This commit gives GDBus the same policy.
      
      This change was originally made to work around a race condition in
      subprocess spawning (Debian bug #737380, GNOME bug #711090) but
      it seems valid in its own right.
      
      In my opinion as D-Bus maintainer, "dbus-launch --autolaunch" should
      be considered to be an X11 feature, and any future D-Bus enhancements
      (e.g. kdbus) or successors for X11 (e.g. Wayland, Mir) should obtain
      a session bus address by other means - either a session manager
      such as "systemd --user", gnome-session or Upstart, or a wrapper
      for the user session like dbus-run-session(1).
      
      Related to dbus bug <https://bugs.freedesktop.org/show_bug.cgi?id=19997>.
      
      Bug: https://bugzilla.gnome.org/show_bug.cgi?id=723506
      Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737380Signed-off-by: Simon McVittie's avatarSimon McVittie <simon.mcvittie@collabora.co.uk>
      0f2e4fd0
  12. 29 Jun, 2016 1 commit
  13. 03 Mar, 2016 1 commit
    • LRN's avatar
      W32: eliminate busy cursor when a rundll32-hosted child runs · 74b1dd87
      LRN authored
      Even though GetStartupInfo() in g_win32_run_session_bus() would
      tell us that STARTF_FORCEONFEEDBACK flag is not set, it still
      affects the rundll32 process for some reason.
      
      This means that Windows WM changes mouse cursor to IDC_APPSTARTING for
      a few seconds when rundll32 runs g_win32_run_session_bus(). Since
      g_win32_run_session_bus() never satisfies the conditions set by
      STARTF_FORCEONFEEDBACK, the busy cursor only goes away after a
      timeout.
      
      Fix this by explicitly running GetMessage(). To ensure that GetMessage()
      doesn't block, post a quit message immediately before calling it.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=760694
      74b1dd87
  14. 03 Feb, 2016 1 commit
  15. 03 Oct, 2015 1 commit
  16. 09 Jun, 2015 2 commits
  17. 04 Apr, 2015 1 commit
  18. 09 Feb, 2014 1 commit
    • Matthias Clasen's avatar
      Docs: Drop entities, switch away from sgml mode · 35066ed6
      Matthias Clasen authored
      Since all element markup is now gone from the doc comments,
      we can turn off the gtk-doc sgml mode, which means that from
      now on, docbook markup is no longer allowed in doc comments.
      
      To make this possible, we have to replace all remaining
      entities in doc comments by their replacement text, &amp; -> &
      and so on.
      35066ed6
  19. 08 Feb, 2014 1 commit
  20. 01 Feb, 2014 1 commit
  21. 31 Jan, 2014 1 commit
  22. 12 Dec, 2013 1 commit
  23. 27 Nov, 2013 1 commit
  24. 21 Aug, 2013 1 commit
    • Chun-wei Fan's avatar
      gio/gdbusaddress.c: Silence RunDLL errors · bb7b0a8c
      Chun-wei Fan authored
      The RunDLL command call during get_session_address_dbus_launch() was
      expecting _g_win32_run_session_bus@16 and g_win32_run_session_bus
      on Win32 and Win64 respectively at least when GLib is compiled with MSVC,
      not g_win32_run_session_bus@16, which caused annoying RunDLL error dialogue
      boxes to show up during the use of GtkApplication (such as when running
      gtk3-demo-application on Windows), prevented GtkApplication items from
      being run for more than one time during the lifespan of the program,
      and this also interfered with some GTK+ tests, causing them to fail.
      
      Update accordingly to address the issue.
      bb7b0a8c
  25. 21 May, 2013 1 commit
    • Dan Winship's avatar
      Use 'dumb quotes' rather than `really dumb quotes' · 4b94c083
      Dan Winship authored
      Back in the far-off twentieth century, it was normal on unix
      workstations for U+0060 GRAVE ACCENT to be drawn as "‛" and for U+0027
      APOSTROPHE to be drawn as "’". This led to the convention of using
      them as poor-man's ‛smart quotes’ in ASCII-only text.
      
      However, "'" is now universally drawn as a vertical line, and "`" at a
      45-degree angle, making them an `odd couple' when used together.
      
      Unfortunately, there are lots of very old strings in glib, and also
      lots of new strings in which people have kept up the old tradition,
      perhaps entirely unaware that it used to not look stupid.
      
      Fix this by just using 'dumb quotes' everywhere.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=700746
      4b94c083
  26. 13 Feb, 2013 1 commit
  27. 15 Nov, 2012 1 commit
  28. 16 Oct, 2012 1 commit
  29. 13 Sep, 2012 1 commit
    • Colin Walters's avatar
      CVE-2012-3524: Hardening for being run in a setuid environment · d6cbb29f
      Colin Walters authored
      Some programs attempt to use libglib (or even libgio) when setuid.
      For a long time, GTK+ simply aborted if launched in this
      configuration, but we never had a real policy for GLib.
      
      I'm not sure whether we should advertise such support.  However, given
      that there are real-world programs that do this currently, we can make
      them safer with not too much effort.
      
      Better to fix a problem caused by an interaction between two
      components in *both* places if possible.
      
      This patch adds a private function g_check_setuid() which is used to
      first ensure we don't run an external dbus-launch binary if
      DBUS_SESSION_BUS_ADDRESS isn't set.
      
      Second, we also ensure the local VFS is used in this case.  The
      gdaemonvfs extension point will end up talking to the session bus
      which is typically undesirable in a setuid context.
      
      Implementing g_check_setuid() is interesting - whether or not we're
      running in a privilege-escalated path is operating system specific.
      Note that GTK+'s code to check euid versus uid worked historically on
      Unix, more modern systems have filesystem capabilities and SELinux
      domain transitions, neither of which are captured by the uid
      comparison.
      
      On Linux/glibc, the way this works is that the kernel sets an
      AT_SECURE flag in the ELF auxiliary vector, and glibc looks for it on
      startup.  If found, then glibc sets a public-but-undocumented
      __libc_enable_secure variable which we can use.  Unfortunately, while
      it *previously* worked to check this variable, a combination of newer
      binutils and RPM break it:
      http://www.openwall.com/lists/owl-dev/2012/08/14/1
      
      So for now on Linux/glibc, we fall back to the historical Unix version
      until we get glibc fixed.
      
      On some BSD variants, there is a issetugid() function.  On other Unix
      variants, we fall back to what GTK+ has been doing.
      Reported-By: default avatarSebastian Krahmer <krahmer@suse.de>
      Signed-off-by: Colin Walters's avatarColin Walters <walters@verbum.org>
      d6cbb29f
  30. 17 Aug, 2012 1 commit
  31. 10 Jul, 2012 1 commit
    • Colin Walters's avatar
      Add g_spawn_check_exit_status() · f7abd3ce
      Colin Walters authored
      Many (if not "almost all") programs that spawn other programs via
      g_spawn_sync() or the like simply want to check whether or not the
      child exited successfully, but doing so requires use of
      platform-specific functionality and there's actually a fair amount of
      boilerplate involved.
      
      This new API will help drain a *lot* of mostly duplicated code in
      GNOME, from gnome-session to gdm.  And we can see that some bits even
      inside GLib were doing it wrong; for example checking the exit status
      on Unix, but ignoring it on Windows.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=679691
      f7abd3ce
  32. 20 Apr, 2012 1 commit
  33. 31 Mar, 2012 1 commit
  34. 15 Mar, 2012 1 commit
  35. 15 Jun, 2011 1 commit
  36. 14 Jun, 2011 2 commits
  37. 13 Apr, 2011 1 commit