Commit Graph

247 Commits

Author SHA1 Message Date
Dan Winship
455afd3545 build: fix a srcdir != builddir problem with gnetworking.h
gio's glib-mkenums call needs to get gnetworking.h out of $(builddir),
not $(srcdir). Fix/simplify it by using $(filter) on $^ and letting
make find everything.

Also add -Wno-portability to AM_INIT_AUTOMAKE in configure.ac, so that
it doesn't warn about this (or about the gmake-specific features we
were already using in gio/tests/)

https://bugzilla.gnome.org/show_bug.cgi?id=691866
2013-01-23 12:49:29 -05:00
Ryan Lortie
304950a7ac Remove regexp-based export control 2013-01-17 10:49:37 -05:00
Matthias Clasen
c4d8eafd00 Bump version 2013-01-15 00:24:27 -05:00
Ryan Lortie
5d42fdd068 visibility: Use a separate CFLAGS variable
We only want to control the default visibility for our five main
installable libraries: libglib, libgthread, libgmodule, libgobject,
libgio.  We should therefore only set -fvisibility=hidden when building
those.

Use a separate substitution variable for this purpose.

Using CFLAGS directly leads to some modules built in testcases not
exporting their symbols (and then the tests fail).  It also affects the
fam file monitoring module.

Colin had originally done it this way in his visibility patch series but
I failed to understand why so I didn't copy it.  Now I do.

Also: revert changes made to two testcases in an attempt to work around
this issue.

https://bugzilla.gnome.org/show_bug.cgi?id=691756
2013-01-14 23:31:59 -05:00
Ryan Lortie
2e7669f5cc configure.ac: change our visibility policy
Check for -fvisibility=hidden as a supported CFLAG.

If it is supported, use it and emit an AC_DEFINE to change the meaning
of _GLIB_EXTERN to include the GNU attribute for marking symbols as
public: __attribute((visibility("default"))).

This will override the public definition of _GLIB_EXTERN for any file
which does #include "config.h" (forcing all our .c files to do so, as a
side effect).

If we're on mingw, assume that -fvisibility will work and also throw in
a __declspec(dllexport) for good measure.  This will allow us to move
away from using a .def file to create the the various DLLs.

It's possible that there may be compilers that accept
-fvisibility=hidden but don't accept the GNU attribute for making
symbols public again -- we will hopefully receive bugs if any of those
exist.

https://bugzilla.gnome.org/show_bug.cgi?id=688681
2013-01-13 22:59:40 -05:00
Henrique Dante de Almeida
0864e3bd6f build: Ensure user-set CFLAGS override defaults
For example, the user should be able disable our default -Werror
settings.

https://bugzilla.gnome.org/show_bug.cgi?id=691608
2013-01-13 10:47:25 -05:00
Javier Jardón
6513e656c0 configure.ac: replace obsolete AC_CONFIG_HEADER with with AC_CONFIG_HEADERS
The former is an obsolete alias to the latter.
It may get removed in the future.
2013-01-07 15:41:19 +00:00
Nirbheek Chauhan
5eba978497 GFile: Add Btrfs clone ioctl support
The attached patch adds support for the btrfs "clone" ioctl which
makes Copy-on-Write reflinks, resulting in cheap O(1) copies when
source/destination are on the same filesystem. The ioctl itself is
quite straightforward, and GNU coreutils has had support since 7.5
(--reflink=auto --sparse=auto).

The ioctl only operates on regular files and symlinks, and always
follows symlinks; checks have been added accordingly.

This patch would be very useful for everyone who uses btrfs
filesystems (Meego folks for instance). On systems that don't have
btrfs, or if the the source is not on a btrfs filesystem, the ioctl
returns EINVAL, and the fallback code is triggered. Hence this will
cause no problems for non-btrfs users.

https://bugzilla.gnome.org/show_bug.cgi?id=626497
2013-01-05 14:21:25 -05:00
Marko Lindqvist
5fbdd3aa27 Remove deprecated AM_PROG_CC_STDC
Fixes automake 1.13 build.

https://bugzilla.gnome.org/show_bug.cgi?id=691011
2013-01-03 19:22:16 -05:00
Matthias Clasen
3e5068c186 Add a --with-python option
The effect is the same as specifying PYTHON=python3, but a
configure option works better in jhbuild.
https://bugzilla.gnome.org/show_bug.cgi?id=684103
2013-01-01 15:49:06 -05:00
Tristan Van Berkom
32c9254277 Adding test coverage for GTestDBus activating in-tree services.
https://bugzilla.gnome.org/show_bug.cgi?id=690543
2012-12-28 21:28:28 -05:00
Daniel Macks
79fab3e647 Add missing autoconf test for sysctlbyname()
uses specific mib[] tokens iff it is available, but configure wasn't
testing for it to be available.

https://bugzilla.gnome.org/show_bug.cgi?id=689324
2012-12-19 14:32:24 -05:00
Matthias Clasen
9061d91605 bump version 2012-12-17 19:18:13 -05:00
PHO
72d7d23402 Remove an unneeded escaping in NAMESER_COMPAT_INCLUDE
In configure.ac, escaping '#' in NAMESER_COMPAT_INCLUDE results in the following gio/gnetworking.h, which obviously doesn't compile:

  #include <arpa/inet.h>
  #include <arpa/nameser.h>
  \#include <arpa/nameser_compat.h>

https://bugzilla.gnome.org/show_bug.cgi?id=690346
2012-12-17 08:54:12 -05:00
Dan Winship
211ed1775d gsocket: add getsockopt/setsockopt wrappers
Add g_socket_get_option() and g_socket_set_option(), wrapping
getsockopt/setsockopt for the case of integer-valued options. Update
code to use these instead of the underlying calls.

https://bugzilla.gnome.org/show_bug.cgi?id=623187
2012-12-12 15:20:22 +01:00
Dan Winship
b377e69685 Add gnetworking.h
Install a public "gnetworking.h" header that can be used to include
the relevant OS-dependent networking headers. This does not really
abstract away unix-vs-windows however; error codes, in particular,
are incompatible.

gnetworkingprivate.h now contains just a few internal URI-related
functions

Also add a g_networking_init() function to gnetworking.h, which can be
used to explicitly initialize OS-level networking, rather than having
that happen as a side-effect of registering GInetAddress.

https://bugzilla.gnome.org/show_bug.cgi?id=623187
2012-12-12 15:20:22 +01:00
Arnel A. Borja
4a506290a7 win32: Use AC_CHECK_TOOL to find dlltool
https://bugzilla.gnome.org/show_bug.cgi?id=684145
2012-12-02 18:12:57 +01:00
Ryan Lortie
37f369a41e stop using libgthread internally
The gobject tools (glib-genmarshal and gobject-query) were linking
against libgthread.  Stop that.

Also, remove the gthread_INCLUDES internal automake substitution.
2012-11-25 14:51:04 -05:00
Krzesimir Nowak
276cf6ceee configure: Make GNUC visibility attribute test more reliable.
Using "int main (int argc, char** argv)" in this test causes GCC to
issue two warnings about unused variable if CFLAGS envvar has
-Wunused-parameter (or just -Wextra). Those warnings are not related
to the attribute checking but they can make the test fail anyway.
2012-11-22 17:33:04 +01:00
Chun-wei Fan
76cecf061b Add autotools scripts to create VS2012 projects
As the project file format for Visual Studio 2012 is only slightly
different from Visual Studio 2010 projects, we can provide support for
building GLib (and other projects) with Visual Studio 2012 with relatively
little effort.  This might change when we eventually get GLib to work with
the Windows 8 (Modern UI/formerly Metro) APIs, but this will suffice for
the time being for people needing to build GLib with Visual Studio 2012.

Basically all that needs to be done at 'make dist' is:
-Copy the .sln/.props/README.txt/.vcxproj files and replace the VS2010
 stuff with VS2012 stuff
-Copy the .vcxproj.filters as is
2012-11-22 08:56:51 +08:00
Olivier Blin
5900d60d06 configure: add missing square bracket in AS_IF for memmove
This has been broken in commit 54e31ab4f1
It seems to be the only hunk that was incorrectly converted.

https://bugzilla.gnome.org/show_bug.cgi?id=688377
2012-11-21 17:56:12 -05:00
Ryan Lortie
cdc95d31e6 *bump* 2012-11-19 18:20:41 -05:00
Dan Winship
731b469908 win32: define _WIN32_WINNT globally
Rather than defining _WIN32_WINNT only in a handful of files, define
it in config.h, like we do with _GNU_SOURCE.

(Also remove a "#define WIN32_LEAN_AND_MEAN" that isn't really all
that useful.)

https://bugzilla.gnome.org/show_bug.cgi?id=688109
2012-11-15 14:19:05 -05:00
Michael Natterer
49db979922 Revert "gmain: Add private API to create Unix child watch that uses waitid()"
This reverts commit 93bf37ce15.
2012-11-15 15:33:38 +01:00
Antoine Jacoutot
a335fd1de8 GFileMonitor: Add kqueue(3) support to GIO
Written by Dmitry Matveev as part of GSoC 2011:
http://netbsd-soc.sourceforge.net/projects/kqueue4gio/

This brings native file monitoring support on systems supporting kqueue(3)
(all BSDs) and remove the need to rely on the unmaintained gamin software.
The backend adds GKqueueDirectoryMonitor and GKqueueFileMonitor.

Some parts rewritten by myself (to prevent needing a configuration file).
Helpful inputs from Colin Walters and Simon McVittie.

https://bugzilla.gnome.org/show_bug.cgi?id=679793
2012-11-15 08:13:30 +01:00
Colin Walters
93bf37ce15 gmain: Add private API to create Unix child watch that uses waitid()
This avoids collecting the zombie child, which means that the PID
can't be reused.  This prevents possible race conditions that might
occur were one to send e.g. SIGTERM to a child.

This race condition has always existed due to the way we called
waitpid() for the app, but the window was widened when we moved the
waitpid() calls into a separate thread.

If waitid() isn't available, we return NULL, and consumers of this
private API (namely, GSubprocess) will need to handle that.

https://bugzilla.gnome.org/show_bug.cgi?id=672102
2012-11-14 14:11:57 -05:00
Ryan Lortie
77032ea390 belated version bump 2012-11-06 07:41:13 -05:00
Colin Walters
28b30caecb configure: Enable set of standard -Werror=foo flags
We're not going to depend on gnome-common (I assume) so this patch
nicks the systemd macro to test for compiler flags, and uses it to set
a similar set of -Werror=foo as the gnome-common one does.

See https://bugzilla.gnome.org/show_bug.cgi?id=608953
See https://mail.gnome.org/archives/desktop-devel-list/2012-July/msg00100.html

If we're going to be setting more strict compiler flags for GNOME, we
should really ensure GLib builds with them first, as it's kind of the
model citizen.

In particular, you can see several times that downstreams such as
Debian have come in and fixed -Wformat-security bugs.  We should never
let those get into tarballs, or even commits.

https://bugzilla.gnome.org/show_bug.cgi?id=687385
2012-11-02 09:03:52 -04:00
Ryan Lortie
7d17fd6f61 Release GLib 2.35.1 2012-10-22 22:20:47 +02:00
Christian Persch
47bc95c0db build: Post branch version bump 2012-10-03 13:58:19 +02:00
Matthias Clasen
9fa86cf217 Bump version 2012-09-23 22:39:20 -04:00
Matthias Clasen
b470097b8b 2.34.0 2012-09-23 22:34:05 -04:00
Ryan Lortie
2cffb96088 bump version 2012-09-18 08:38:04 -04:00
Ryan Lortie
a47761a36e GLib 2.33.14 2012-09-17 17:53:58 -04:00
Colin Walters
d6cbb29f59 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:34:29 -04:00
Matthias Clasen
dad25c4819 Bump version 2012-09-03 16:27:19 -04:00
Matthias Clasen
626abfdc10 2.33.10 2012-09-03 15:14:18 -04:00
Ryan Lortie
221bbd8d76 *bump*
thanks rico :)
2012-08-21 16:32:17 -04:00
Ryan Lortie
ed40bf6715 NEWS, versions, etc. 2012-08-20 18:36:51 -04:00
Javier Jardón
f8a5fc2e2e Revert "Use upstream gettext instead the glib one"
Commited by mistake
This reverts commit e930e3b3aa.
2012-08-15 02:46:16 +09:00
Javier Jardón
e930e3b3aa Use upstream gettext instead the glib one 2012-08-15 01:41:11 +09:00
Colin Walters
ddfcfa66ae build: Switch back to using AS_IF for conditionals
See https://bugzilla.gnome.org/show_bug.cgi?id=674483

https://bugzilla.gnome.org/show_bug.cgi?id=681413
2012-08-08 10:37:39 -04:00
Ryan Lortie
69dd29296e bump version 2012-08-06 16:20:36 -04:00
Ryan Lortie
6b43310ef4 GLib 2.33.8 2012-08-06 15:56:26 -04:00
Matthias Clasen
cc80ae321f Solaris build fix for GIO
Solaris/OpenSolaris/OpenIndiana define FIONREAD in sys/filio.h.
This commit adds a configure check for this header, and includes
it conditionally in gio/gsocket.c.

Patch by Fabian Groffen, bug 675524.
2012-08-06 11:55:59 -04:00
Matthias Clasen
0b8662635d configure.ac: Use AS_HELP_STRING throughout
https://bugzilla.gnome.org/show_bug.cgi?id=680831
2012-08-06 08:52:58 -04:00
Javier Jardón
0f6a092cc5 Make gtk-doc not a hard dependency of GLib
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=674314
2012-08-05 22:29:28 +09:00
Matthias Clasen
9f9ab64030 Rework the man page configury
Default to generate man pages if the required tools and
stylesheets are found. Error out if --enable-man is given
but tools or stylesheets are missing.
2012-08-03 23:36:45 -04:00
Matthias Clasen
0e37822e10 Bump version 2012-07-17 14:23:08 -04:00
Matthias Clasen
e97a4c7e5e 2.33.6
https://bugzilla.gnome.org/show_bug.cgi?id=680111
2012-07-17 13:47:26 -04:00