Commit Graph

31 Commits

Author SHA1 Message Date
Sophie Herold
0d268c4825 Remove all nicks and blurbs from param specs
Nicks and blurbs don't have any practical use for gio/gobject libraries.
Leaving tests untouched since this features is still used by other libraries.

Closes #2991
2023-11-29 13:41:34 +00:00
Philip Withnall
68d3f6e53a docs: Move the GUnixCredentialsMessage SECTION
Move it to the struct docs.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Helps: #3037
2023-11-02 16:30:23 +00:00
Philip Withnall
5942cd7984 gio: Add SPDX license headers automatically
Add SPDX license (but not copyright) headers to all files which follow a
certain pattern in their existing non-machine-readable header comment.

This commit was entirely generated using the command:
```
git ls-files gio/*.[ch] | xargs perl -0777 -pi -e 's/\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/\n \*\n \* SPDX-License-Identifier: LGPL-2.1-or-later\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/igs'
```

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #1415
2022-05-18 09:18:52 +01:00
Marc-André Lureau
af1777d3d3 meson: compile GUnixCredentialsMessage on all platforms
The header is now also installed under the common GIO include directory.

Sorry if it breaks any build, you had to use the correct header path.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-01-26 18:19:44 +04:00
Dr. Michael Lauer
ec2f60a008 gio: add gcredential support for macOS
[smcv: Apply my review feedback from
<https://bugzilla.gnome.org/show_bug.cgi?id=668866>]

Co-authored-by: Simon McVittie <smcv@collabora.com>
Resolves: https://gitlab.gnome.org/GNOME/glib/issues/507
2020-05-07 14:19:16 +01:00
Sébastien Wilmet
3bf4a720c3 gio/: LGPLv2+ -> LGPLv2.1+
Sub-directories inside gio/ already processed in a previous commit:
- fam/
- gdbus-2.0/ (which contains only codegen/)
- gvdb/
- inotify/
- tests/
- win32/
- xdgmime/

Other sub-directories inside gio/:
- completion/: no license headers
- kqueue/: not LGPL, BSD-style license

https://bugzilla.gnome.org/show_bug.cgi?id=776504
2017-05-29 19:53:34 +02:00
Patrick Welche
afce39c228 gcredentials: add NetBSD support
https://bugzilla.gnome.org/show_bug.cgi?id=728256
2014-06-28 14:06:36 -04:00
Dan Winship
5a269e5a90 gcredentials: add Solaris support
Based on patches from Igor Pashev.

https://bugzilla.gnome.org/show_bug.cgi?id=705029
2013-10-04 09:51:31 -04:00
Dan Winship
cedd697bf8 gcredentials: add internal macros to simplify all the #ifdefs
Rather than having lots of obscure platform-based #ifdefs all over
gio, define some macros in gcredentialsprivate.h, and use those to
simplify the rest of the code.

https://bugzilla.gnome.org/show_bug.cgi?id=701482
2013-10-04 09:51:31 -04:00
Emmanuele Bassi
54cc43630d Rename the generated private data getter function
As it turns out, we have examples of internal functions called
type_name_get_private() in the wild (especially among older libraries),
so we need to use a name for the per-instance private data getter
function that hopefully won't conflict with anything.
2013-06-24 15:43:04 +01:00
Emmanuele Bassi
32747def4b gio: Use the new private instance data declaration
Use the newly added macros, and remove the explicit calls to
g_type_class_add_private().

https://bugzilla.gnome.org/show_bug.cgi?id=700035
2013-06-24 14:18:01 +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
Simon McVittie
1afaea333b Use the FreeBSD credentials-passing code on Debian GNU/kFreeBSD
The __FreeBSD__ macro means we have both a FreeBSD kernel and FreeBSD
libc, which isn't the case on GNU/kFreeBSD (GNU libc and userland on
the FreeBSD kernel), so it predefines a different macro. The kernel
is what actually matters for credentials-passing, though.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Tested-by: Steven Chamberlain <steven@pyro.eu.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=649302
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581750
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=631968
Reviewed-by: Dan Winship <danw@gnome.org>
2012-11-02 13:55:40 +00:00
Alexander Larsson
ec91ed00f1 Detect "empty" socket credentials on Linux
Linux uses struct ucred to pass over socket credentials. Historically
this has always worked in recievemsg, if SO_PASSCRED was set on the socket,
even if the remote side didn't pass any credits. But this change broke that:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=16e5726269611b71c930054ffe9b858c1cea88eb;hp=a9e9fd7182332d0cf5f3e601df3e71dd431b70d7

However, it doesn't actually fail getting the credentials, it just returns
an "empty" one, as initialized by cred_to_ucred() at:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=net/core/sock.c;h=b29ab61b029cf7f76fda992ecfcb8dcaa06b0483;#l756

So, we detect this and fail the credentials reading.

This actually happened in real life with gdbus acting as a server, as
gdbus expected an ucred but libdbus didn't send one.
2012-04-12 16:43:49 +02:00
Dan Winship
aa10574dc3 gunixcredentialsmessage: fix this on FreeBSD
pointed out by Henry Hu
https://bugzilla.gnome.org/show_bug.cgi?id=628904
2011-08-27 12:28:03 -04:00
Matthias Clasen
01f63b19f9 Fix links in gio docs 2011-06-04 18:48:19 -04:00
Dan Winship
e56498ee0b Fix usage of _GNU_SOURCE
_GNU_SOURCE must be defined before including any other (system)
header, so defining it in glib-unix.h (and hoping no one has included
anything else before that) is wrong. And the "#define _USE_GNU"
workaround for this problem in gnetworkingprivate.h is even wronger
(and still prone to failure anyway due to single-include guards).

Fix this by defining _GNU_SOURCE in config.h when building against
glibc. In theory this is bad because new releases of glibc may include
symbols that conflict with glib symbols, which could then cause
compile failures. However, most people only see new releases of glibc
when they upgrade their distro, at which point they also generally get
new releases of gcc, which have new warnings/errors to clean up
anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=649201
2011-05-03 07:07:41 -04:00
Johan Dahlin
fdaaa22b58 Correct gtk-doc SECTION: syntax
g-ir-scanner does not allow a space between the : and the
section name.
2011-02-01 16:18:02 -02:00
Johan Dahlin
30132c44c1 Add a lot of missing annotations 2010-09-24 18:24:41 -03:00
Joe Marcus Clarke
964eb62343 Bug 628904 – Add credential support for FreeBSD and fix a socket issue
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 14:10:01 -04:00
David Zeuthen
7eba41346e Bug 617483 – Credentials passing
- Make GCredentials instance and class structures private so it can't
   be subclassed and we don't have to worry about ABI compat
   issues. This also allows us to get rid of the GCredentialsPrivate
   struct.

 - Add a GCredentialsType enumeration that is used whenever exchanging
   pointers with the user. This allows us to support OSes with
   multiple native credential types. In particular, it allows
   supporting OSes where the native credential evolves or even changes
   over time.

 - Add g_socket_get_credentials() method.

 - Add tests for g_socket_get_credentials(). Right now this is in the
   GDBus peer-to-peer test case but we can change that later.

 - Move GTcpConnection into a separate gtk-doc page as was already
   half-done with GUnixConnection. Also finish the GUnixConnection
   move and ensure send_credentials() and receive_credentials()
   methods are in the docs. Also nuke comment about GTcpConnection
   being empty compared to its superclass.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-20 16:34:18 -04:00
Ryan Lortie
5b946e0504 gio/: fully remove gioalias hacks 2010-07-07 19:53:22 -04:00
Matthias Clasen
2ad4b2d716 Fix build on !linux
Don't define __USE_GNU, thats a glibc-internal macro, and
don't use SOL_SOCKET when not including sys/socket.h.
Maybe this file should be called glinuxcredentialsmessage.c...

Bug #618730
2010-05-15 18:16:51 -04:00
Matthias Clasen
4e7764fb2d Documentation cleanups 2010-05-14 00:21:39 -04:00
Matthias Clasen
e4b1e48fca Match up parameter names
and similar cleanups to make gtk-doc happy.
2010-05-11 20:57:44 -04:00
Matthias Clasen
25a8aa5d88 Cosmetic fixes
Use P_() for properties, fix up indentation, etc.
2010-05-09 22:13:18 -04:00
David Zeuthen
c148cafdd1 GDBus: Rework GCredentials type
These changes are is related to

 https://bugzilla.gnome.org/show_bug.cgi?id=617483

and IRC discussions with danw.
2010-05-09 10:03:56 -04:00
David Zeuthen
46ce134d51 GDBus: Add new symbols to gio.symbols 2010-05-06 17:31:51 -04:00
David Zeuthen
fb1b4599a0 GDBus: Fix up i18n 2010-05-06 16:34:23 -04:00
David Zeuthen
0fd6498cd8 Add "Since: 2.26" to all new GDBus API 2010-05-06 16:02:08 -04:00
David Zeuthen
d0a14469d0 Initial GDBus code-drop from GDBus-standalone repo
Things compile and the test-suite passes. Still need to hook up
gio.symbols and docs. There are still a bunch of TODOs left in the
sources that needs to be addressed.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-06 14:21:32 -04:00