BRoster::Private::SendTo() cannot be used in registrar.

* We're checking with IsTargetLocal() if we're allowed to access
  it or not.
* This might introduce regressions, if the registrar is using its own
  services via the BRoster API.
* This fixes a deadlock when the system clipboard tries to get
  initialized within the registrar.
This commit is contained in:
Axel Dörfler 2015-04-15 18:05:37 +02:00
parent 9bfc8331bb
commit 2bc07d285e
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2001-2009, Haiku.
* Copyright 2001-2015, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -67,6 +67,8 @@ BRoster::Private::SendTo(BMessage *message, BMessage *reply, bool mime)
const BMessenger& messenger = mime
? fRoster->_MimeMessenger() : fRoster->fMessenger;
if (messenger.IsTargetLocal())
return B_BAD_VALUE;
return reply != NULL
? messenger.SendMessage(message, reply)