/*
Authors:
Pavel Březina <pbrezina@redhat.com>
Copyright (C) 2016 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <talloc.h>
#include "sbus/sssd_dbus.h"
struct sbus_talloc_msg {
bool in_talloc_destructor;
};
{
talloc_msg->in_talloc_destructor = true;
return 0;
}
/* There may exist more references to this message but this talloc
* context is no longer valid. We remove dbus message data to invoke
* dbus destructor now. */
return 0;
}
{
if (!talloc_msg->in_talloc_destructor) {
/* References to this message dropped to zero but through
* dbus_message_unref(), not by calling talloc_free(). We need to free
* the talloc context and avoid running talloc desctuctor. */
}
}
{
/* Create a talloc context that will unreference this message when
* the parent context is freed. */
if (talloc_msg == NULL) {
"Unable to bound D-Bus message with talloc context!\n");
return ENOMEM;
}
/* Allocate a dbus message data slot that will contain point to the
* talloc context so we can pick up cases when the dbus message is
* freed through dbus api. */
if (!bret) {
return ENOMEM;
}
if (!bret) {
return ENOMEM;
}
talloc_msg->in_talloc_destructor = false;
return EOK;
}
{
static struct {
const char *name;
{ SBUS_ERROR_NOT_FOUND, ENOENT },
{ SBUS_ERROR_DP_NOTSUP, ENOTSUP },
{ NULL, ERR_INTERNAL } };
int i;
if (!dbus_error_is_set(error)) {
return EOK;
}
}
}
return EIO;
}
{
switch (dbus_message_get_type(reply)) {
goto done;
case DBUS_MESSAGE_TYPE_ERROR:
if (bret == false) {
goto done;
}
goto done;
default:
ret = ERR_INTERNAL;
goto done;
}
done:
return ret;
}
const char *bus,
const char *path,
const char *iface,
const char *method,
int first_arg_type,
{
return NULL;
}
if (!bret) {
goto done;
}
done:
}
return msg;
}
const char *bus,
const char *path,
const char *iface,
const char *method,
int first_arg_type,
...)
{
first_arg_type, va);
return msg;
}
bool check_reply,
int first_arg_type,
{
if (check_reply) {
return ret;
}
}
if (bret == false) {
goto done;
}
goto done;
}
done:
return ret;
}
bool check_reply,
int first_arg_type,
...)
{
return ret;
}