mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-25 11:42:10 +01:00
GDBusServer: Document that a GDBusAuthObserver is usually desirable
Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
b6988b685f
commit
1031e466cf
@ -41,9 +41,11 @@
|
|||||||
*
|
*
|
||||||
* ## Controlling Authentication # {#auth-observer}
|
* ## Controlling Authentication # {#auth-observer}
|
||||||
*
|
*
|
||||||
* For example, if you only want to allow D-Bus connections from
|
* By default, a #GDBusServer or server-side #GDBusConnection will accept
|
||||||
* processes owned by the same uid as the server, you would use a
|
* connections from any successfully authenticated user (but not from
|
||||||
* signal handler like the following:
|
* anonymous connections using the `ANONYMOUS` mechanism). If you only
|
||||||
|
* want to allow D-Bus connections from processes owned by the same uid
|
||||||
|
* as the server, you would use a signal handler like the following:
|
||||||
*
|
*
|
||||||
* |[<!-- language="C" -->
|
* |[<!-- language="C" -->
|
||||||
* static gboolean
|
* static gboolean
|
||||||
|
@ -72,6 +72,11 @@
|
|||||||
*
|
*
|
||||||
* An example of peer-to-peer communication with G-DBus can be found
|
* An example of peer-to-peer communication with G-DBus can be found
|
||||||
* in [gdbus-example-peer.c](https://git.gnome.org/browse/glib/tree/gio/tests/gdbus-example-peer.c).
|
* in [gdbus-example-peer.c](https://git.gnome.org/browse/glib/tree/gio/tests/gdbus-example-peer.c).
|
||||||
|
*
|
||||||
|
* Note that a minimal #GDBusServer will accept connections from any
|
||||||
|
* peer. In many use-cases it will be necessary to add a #GDBusAuthObserver
|
||||||
|
* that only accepts connections that have successfully authenticated
|
||||||
|
* as the same user that is running the #GDBusServer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -457,6 +462,10 @@ on_run (GSocketService *service,
|
|||||||
* Once constructed, you can use g_dbus_server_get_client_address() to
|
* Once constructed, you can use g_dbus_server_get_client_address() to
|
||||||
* get a D-Bus address string that clients can use to connect.
|
* get a D-Bus address string that clients can use to connect.
|
||||||
*
|
*
|
||||||
|
* To have control over the available authentication mechanisms and
|
||||||
|
* the users that are authorized to connect, it is strongly recommended
|
||||||
|
* to provide a non-%NULL #GDBusAuthObserver.
|
||||||
|
*
|
||||||
* Connect to the #GDBusServer::new-connection signal to handle
|
* Connect to the #GDBusServer::new-connection signal to handle
|
||||||
* incoming connections.
|
* incoming connections.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user