summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusserver.cpp
diff options
context:
space:
mode:
authorRoland Winklmeier <Roland.M.Winklmeier@gmail.com>2014-01-13 21:49:49 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-15 14:15:22 +0100
commit419a1f53d527583458da46d1508aab272fdf0280 (patch)
tree374c0a203d118e76a31f1bde3797c1ec01b76826 /src/dbus/qdbusserver.cpp
parent40133df06fea67ab3983b90844cc2a8f47e6e20c (diff)
Add method to QDBusServer to allow anonymous client connections.
This change adds a new method to QDBusServer to allow anonymous connections. This is part of the DBus API and was not yet possible to use with QDBusServer. It is set in the newConnection callback when a new client tries to connect. Anonymous connections are enabled by default in DBus but not allowed by default. [ChangeLog][QtDBus][QDBusServer] Added method to QDBusServer to allow anonymous client connections, even if the connecting client is not authenticated as a user. Change-Id: I984c9e634101ecd2e67bb25c8d12bb1071836fd3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus/qdbusserver.cpp')
-rw-r--r--src/dbus/qdbusserver.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/dbus/qdbusserver.cpp b/src/dbus/qdbusserver.cpp
index 170e6ff5cf..a9dd72036c 100644
--- a/src/dbus/qdbusserver.cpp
+++ b/src/dbus/qdbusserver.cpp
@@ -150,6 +150,33 @@ QString QDBusServer::address() const
}
/*!
+ \since 5.3
+
+ If \a value is set to true, an incoming connection can proceed even if the
+ connecting client is not authenticated as a user.
+
+ By default, this value is false.
+
+ \sa isAnonymousAuthenticationAllowed()
+*/
+void QDBusServer::setAnonymousAuthenticationAllowed(bool value)
+{
+ d->anonymousAuthenticationAllowed = value;
+}
+
+/*!
+ \since 5.3
+
+ Returns true if anonymous authentication is allowed.
+
+ \sa setAnonymousAuthenticationAllowed()
+*/
+bool QDBusServer::isAnonymousAuthenticationAllowed() const
+{
+ return d->anonymousAuthenticationAllowed;
+}
+
+/*!
\fn void QDBusServer::newConnection(const QDBusConnection &connection)
This signal is emitted when a new client connection \a connection is