Commit Graph

12359 Commits

Author SHA1 Message Date
Colin Walters
4c2928a544 CVE-2012-3524: Hardening for being run in a setuid environment
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: Sebastian Krahmer <krahmer@suse.de>
Signed-off-by: Colin Walters <walters@verbum.org>
2012-09-13 18:33:08 -04:00
Alexandre Franke
332d7edb1e Update French translation 2012-09-09 19:51:51 +02:00
Marek Černocký
761af10226 Updated Czech translation 2012-09-08 11:15:29 +02:00
Marek Černocký
75702036b2 Updated Czech translation 2012-09-05 10:55:05 +02:00
Daniel Mustieles
ff4c8dea13 Updated Spanish translation 2012-09-03 16:17:17 +02:00
Daniel Mustieles
090c461657 Updated Spanish translation 2012-09-03 15:57:55 +02:00
Marc-André Lureau
3d8307d042 win32: fix build after bug 674452 2012-08-22 10:09:37 -04:00
Gil Forcada
4f47b9d235 [l10n] Updated Catalan translation 2012-08-12 13:50:45 +02:00
Adorilson Bezerra
7339fc089b Fixed some strings in Brazilian Portuguese translation 2012-08-10 09:46:52 -03:00
Nilamdyuti Goswami
86afc6d2b0 Assamese translation updated 2012-08-08 14:28:21 +05:30
Chun-wei Fan
b02b92172d Revert "gio/Makefile.am: Filter out gcontenttype.c for MSVC builds"
This reverts commit 18801a9a7b.

The change to the GIO source filters only applies to the master/2.33.x+
branch as there isn't a gcontenttype-win32.c in glib-2-32, so we still
want to build gcontenttype.c here.
2012-08-07 12:36:35 +08:00
Chun-wei Fan
18801a9a7b gio/Makefile.am: Filter out gcontenttype.c for MSVC builds
gcontenttype.c was split into gcontenttype.c and gcontenttype-win32.c
in commit 32192ee9 ("Split gcontenttype.c"), so we don't want to include
gcontenttype.c in the Visual C++ build as it is no longer a source file
meant for Windows.

Thanks to Thomas H.P. Anderson for pointing this out.
2012-08-06 08:37:06 -04:00
Mark Nauwelaerts
b91a241127 gclosure: do not copy and leak when generically marshalling return value
https://bugzilla.gnome.org/show_bug.cgi?id=674800
2012-08-05 13:09:39 +01:00
Mark Nauwelaerts
16de33733c tests: add check for leaking signal return value
https://bugzilla.gnome.org/show_bug.cgi?id=674800
2012-08-05 13:09:36 +01:00
Mark Nauwelaerts
a6819124a3 tests: make refcount signals test slightly valgrind cleaner 2012-08-05 13:09:32 +01:00
Fran Diéguez
c12428c4e5 Updated Galician translations 2012-07-27 12:10:10 +02:00
Tobias Endrigkeit
c89e8407d1 [l10n] Updated German translation 2012-07-23 22:11:01 +02:00
Matej Urbančič
b1de0eafbd Updated Slovenian translation 2012-07-19 09:12:35 +02:00
Sasi Bhushan Boddepalli
eb07f12d72 Updated Telugu Translation 2012-07-17 17:20:56 +05:30
Daniel Mustieles
9ca29a72ee Updated Spanish translation 2012-07-16 17:40:31 +02:00
Daniel Mustieles
d74afc853b Updated Spanish translation 2012-07-16 17:16:07 +02:00
Piotr Drąg
3549af0891 Updated Polish translation 2012-07-15 01:23:59 +02:00
Matthias Clasen
b47ed0b1aa Bump version 2012-07-14 19:22:31 -04:00
Matthias Clasen
780a677100 Updates for 2.32.4 2.32.4 2012-07-14 18:03:45 -04:00
Matthias Clasen
be0bef91de GApplication: remove reference to non-existing example
There's no example called gapplication-example-menu.c in
the gio/tests/ directory.
2012-07-14 18:03:45 -04:00
Matthias Clasen
ddd7f7475a Fix contenttype tests 2012-07-14 16:50:35 -04:00
Matthias Clasen
069f429990 Fix GModule documentation a bit
The documentation for g_module_make_resident was for some reason
in the doc comment for g_module_name.

https://bugzilla.gnome.org/show_bug.cgi?id=679813
2012-07-14 16:33:23 -04:00
Rui Matos
aa6239d999 GDBusNodeInfo: remove a spurious for loop
https://bugzilla.gnome.org/show_bug.cgi?id=679671
2012-07-14 16:33:23 -04:00
Rui Matos
f0fe7d5ec9 GDBusNodeInfo: the XML string must contain exactly one node element
Make the documentation clear about this.

https://bugzilla.gnome.org/show_bug.cgi?id=679671
2012-07-14 16:33:22 -04:00
Ryan Lortie
3f0ed5c26b GVariant: fix string validation
String validation was done by checking if the string was valid utf8 and
ensuring that the first non-utf8 character was the last character (ie:
the nul terminator).

No check was actually done to make sure that this byte actually
contained a nul, however, so it was possible that you could have a
string like "hello\xff" with length 6 that would correctly validate.

Fix that, and test it.
2012-07-14 16:33:22 -04:00
Antoine Jacoutot
c9b399365f goptions: use G_N_ELEMENTS instead of nitems 2012-07-14 16:33:22 -04:00
Antoine Jacoutot
9e0ea40537 OpenBSD: explicitely define nitems
nitems is never guaranteed to be defined in sys/params.h as it is meant
to be defined within a protected ifdef __KERNEL condition.
2012-07-14 16:33:22 -04:00
Ryan Lortie
f6b98fe7a7 GVariant: support comparing booleans
g_variant_compare() is documented as working on booleans but somehow
this case was missed.  Add it and test it.

Problem discovered by Charles Kerr.
2012-07-14 16:33:21 -04:00
Ryan Lortie
e6f659a898 GSettings: be more careful about keys names with /
Prevent attempts to access keys ending with slashes that exist in the
schema file as references to child schemas.

Also: don't emit change signals for these same keys.
2012-07-14 16:33:21 -04:00
Emmanuele Bassi
6f2b9223be Constify collect and lcopy strings in GTypeValueTable
This avoids warnings when creating idiomatic value tables, like:

  static const GTypeValueTable _clutter_shader_float_value_table = {
    clutter_value_init_shader_float,
    clutter_value_free_shader_float,
    clutter_value_copy_shader_float,
    clutter_value_peek_pointer,
    "ip",
    clutter_value_collect_shader_float,
    "pp",
    clutter_value_lcopy_shader_float
  };

Because the strings are literals. And, really: nobody should be using
allocated values for the collection and lcopy strings.

https://bugzilla.gnome.org/show_bug.cgi?id=671545
2012-07-14 16:33:21 -04:00
Matthias Clasen
89c5e035b3 Improve the g_dir_read_name documentation
This function can return NULL in error cases as well. Document
this, and explain how to discriminate the cases.
https://bugzilla.gnome.org/show_bug.cgi?id=639771
2012-07-14 16:33:20 -04:00
Neil Roberts
1eea903dcf Fix the 'Since' tag for G_SOURCE_{REMOVE,CONTINUE}
The Since tag for these was saying 2.28 but it was actually added in
2.31. It looks like all of the Since tags list stable version numbers
so this patch bumps that up to 2.32.

https://bugzilla.gnome.org/show_bug.cgi?id=679258
2012-07-14 16:33:20 -04:00
Simon Feltman
33f886995a Updated codegen to work with python3.
Most changes were just replacing usage of "has_key" with "in".
Also updated the sorting function which was simplified and
changed to a "key" function instead of "cmp" (which is no longer
supported in python3. Verified everything builds with
python 2.7 and 3.

https://bugzilla.gnome.org/show_bug.cgi?id=678066
2012-07-14 16:33:20 -04:00
Johan Dahlin
c147bd5b1a Use the same Python as we found in configure
Don't assume /usr/bin/python is python 2.x, on newer Ubuntu versions
it's actually python 3.x.
2012-07-14 16:33:19 -04:00
Martin Pitt
4b8c6f9d02 Fix /contenttype/guess test
After fixing bug 674452 this test case now reliably fails, as "ABC abc" is text
and definitively not PowerPoint. It previously worked as g_content_type_guess()
was reading beyond the boundary of the data due to specifying -1 as data
length.

Update that test case to expect a PO template instead, and add two more with a
definitive PO template syntax and some binary data. We do not currently have a
MIME magic for PowerPoint, so we cannot actually detect it with certainty, but
at least make sure that the returned MIME type is correct.

https://bugzilla.gnome.org/show_bug.cgi?id=678941
2012-07-14 16:33:19 -04:00
Alexander Larsson
e58a2996ba Fix the mimetype default fix
We need to ignore the defaults.list item only when there
was a mimetype handler found in a previous mimetype, not
if one was found for the same mimetype as the one that
is listed in defaults.list (same for the new-style defaults).
2012-07-14 16:33:19 -04:00
Alexander Larsson
8d0f19de81 Fix default app lookup wrt parent types and defaults.list
There was an issue when looking up the default handler
for a type where a supertype was listed in defaults.list.
We would pick the default for the parent type even if
there was a handler for the more specific type.

In the case of the new-style defaults marking (
"Default Applications" in mimeapps.list) we were already
checking for a more specific handler befor using a default,
but we also need to do a similar check for the defaults.list
case.

https://bugzilla.gnome.org/show_bug.cgi?id=678944
2012-07-14 16:33:19 -04:00
Stef Walter
5bf587caa0 GTlsInteraction: Fix incorrect locking of mutex
* Fix incorrect locking of mutex in g_tls_interaction_invoke_ask_password()

https://bugzilla.gnome.org/show_bug.cgi?id=678758
2012-07-14 16:33:18 -04:00
Martin Pitt
c1aac005d2 gio/tests/contenttype: Call g_content_type_guess() with valid data len
g_content_type_guess() requires specifying a valid data length. Fixes a
segfault when running the test.

Also add an explicit check for this and return XDG_MIME_TYPE_UNKNOWN when
data_size is specified as -1, to avoid crashing.

https://bugzilla.gnome.org/show_bug.cgi?id=674452
2012-07-14 16:33:18 -04:00
Martin Pitt
7f3295b3b3 /mainloop/timeouts test: Reduce race condition
Due to load, particular traits of the architecture, or other circumstances, the
/mainloop/timeouts sometimes manages to call the "every
100 ms" timer loop only 9 times in 1050 ms.

This is an inherent race-condition in the test; allow it some slack and accept
9 times as well.

https://bugzilla.gnome.org/show_bug.cgi?id=678959
2012-07-14 16:33:18 -04:00
Philipp Kern
567f4d0d12 valuetransform: Fix definition of ulong_bool
On big endian 64 bit machines such as s390x, an uint is too small to hold a
ulong_bool; it needs to be an actual ulong.

https://bugzilla.gnome.org/show_bug.cgi?id=678949
http://bugs.debian.org/662057
2012-07-14 16:33:17 -04:00
Martin Pitt
2e76d87bea Allow slightly too small poll duration in /socket/timed_wait test
Sometimes the poll duration in the /socket/timed_wait test is slightly lower
than the requested 100000, causing failures like

ERROR:/build/buildd/glib2.0-2.33.2/./gio/tests/socket.c:619:test_timed_wait:
  assertion failed (poll_duration > = 100000): (99240 >= 100000)
FAIL

Adjust the test to also allow some jitter in the "too small" direction, similar
to the already existing span for "slightly too large".

https://bugzilla.gnome.org/show_bug.cgi?id=678881
2012-07-14 16:33:17 -04:00
Lars Uebernickel
1da11292da GDbusActionGroup: always set strict when _query_action fails 2012-07-14 16:33:17 -04:00
Matthias Clasen
086603c602 Remove a few redundant ;s 2012-07-14 16:33:17 -04:00
Phil Clayton
e0281b2762 Add missing annotation to GDBusConnection::closed
Add annotation (allow-none) to the parameter error.

https://bugzilla.gnome.org/show_bug.cgi?id=677952
2012-07-14 16:33:16 -04:00