30 namespace SignonDaemonNS {
32 SignonAuthSessionAdaptor::SignonAuthSessionAdaptor(SignonAuthSession *parent):
33 QDBusAbstractAdaptor(parent)
35 setAutoRelaySignals(
true);
38 SignonAuthSessionAdaptor::~SignonAuthSessionAdaptor()
42 void SignonAuthSessionAdaptor::errorReply(
const QString &name,
43 const QString &message)
45 QDBusMessage errReply =
46 static_cast<QDBusContext *
>(parent())->message().
47 createErrorReply(name, message);
48 SIGNOND_BUS.send(errReply);
53 const QStringList &wantedMechanisms)
57 QDBusContext &dbusContext = *
static_cast<QDBusContext *
>(parent());
60 TRACE() <<
"queryAvailableMechanisms called from peer that doesn't "
61 "own the AuthSession object\n";
63 QTextStream(&errMsg) << SIGNOND_PERMISSION_DENIED_ERR_STR
64 <<
" Authentication session owned by other "
66 errorReply(SIGNOND_PERMISSION_DENIED_ERR_NAME, errMsg);
74 const QString &mechanism)
78 QString allowedMechanism(mechanism);
80 if (parent()->
id() != SIGNOND_NEW_IDENTITY) {
90 QTextStream(&errMsg) << SIGNOND_METHOD_OR_MECHANISM_NOT_ALLOWED_ERR_STR
97 errorReply(SIGNOND_METHOD_OR_MECHANISM_NOT_ALLOWED_ERR_NAME,
102 BLAME() <<
"Null database handler object.";
106 QDBusContext &dbusContext = *
static_cast<QDBusContext *
>(parent());
109 TRACE() <<
"process called from peer that doesn't own the AuthSession "
112 QTextStream(&errMsg) << SIGNOND_PERMISSION_DENIED_ERR_STR
113 <<
" Authentication session owned by other "
115 errorReply(SIGNOND_PERMISSION_DENIED_ERR_NAME, errMsg);
116 return QVariantMap();
119 return parent()->
process(sessionDataVa, allowedMechanism);
126 QDBusContext &dbusContext = *
static_cast<QDBusContext *
>(parent());
128 TRACE() <<
"cancel called from peer that doesn't own the AuthSession "
140 QDBusContext &dbusContext = *
static_cast<QDBusContext *
>(parent());
143 TRACE() <<
"setId called from peer that doesn't own the AuthSession "
148 dbusContext.message(), id)) {
149 TRACE() <<
"setId called with an identifier the peer is not allowed "
161 QDBusContext &dbusContext = *
static_cast<QDBusContext *
>(parent());
164 TRACE() <<
"objectUnref called from peer that doesn't own the "
165 "AuthSession object";