sssd_dbus_request.c revision d9577dbd92555b0755881e37724019ef9c578404
d9577dbd92555b0755881e37724019ef9c578404Stef Walter Stef Walter <stefw@redhat.com>
d9577dbd92555b0755881e37724019ef9c578404Stef Walter Copyright (C) 2014 Red Hat
d9577dbd92555b0755881e37724019ef9c578404Stef Walter This program is free software; you can redistribute it and/or modify
d9577dbd92555b0755881e37724019ef9c578404Stef Walter it under the terms of the GNU General Public License as published by
d9577dbd92555b0755881e37724019ef9c578404Stef Walter the Free Software Foundation; either version 3 of the License, or
d9577dbd92555b0755881e37724019ef9c578404Stef Walter (at your option) any later version.
d9577dbd92555b0755881e37724019ef9c578404Stef Walter This program is distributed in the hope that it will be useful,
d9577dbd92555b0755881e37724019ef9c578404Stef Walter but WITHOUT ANY WARRANTY; without even the implied warranty of
d9577dbd92555b0755881e37724019ef9c578404Stef Walter MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d9577dbd92555b0755881e37724019ef9c578404Stef Walter GNU General Public License for more details.
d9577dbd92555b0755881e37724019ef9c578404Stef Walter You should have received a copy of the GNU General Public License
d9577dbd92555b0755881e37724019ef9c578404Stef Walter along with this program. If not, see <http://www.gnu.org/licenses/>.
d9577dbd92555b0755881e37724019ef9c578404Stef Walterstatic int sbus_request_destructor(struct sbus_request *dbus_req)
d9577dbd92555b0755881e37724019ef9c578404Stef Walter dbus_req = talloc_zero(conn, struct sbus_request);
d9577dbd92555b0755881e37724019ef9c578404Stef Walter DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory allocating DBus request\n");
d9577dbd92555b0755881e37724019ef9c578404Stef Walter talloc_set_destructor(dbus_req, sbus_request_destructor);
d9577dbd92555b0755881e37724019ef9c578404Stef Walterint sbus_request_finish(struct sbus_request *dbus_req,
d9577dbd92555b0755881e37724019ef9c578404Stef Walterint sbus_request_return_and_finish(struct sbus_request *dbus_req,
d9577dbd92555b0755881e37724019ef9c578404Stef Walter reply = dbus_message_new_method_return(dbus_req->message);
d9577dbd92555b0755881e37724019ef9c578404Stef Walter DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory allocating DBus message\n");
d9577dbd92555b0755881e37724019ef9c578404Stef Walter dbret = dbus_message_append_args_valist(reply, first_arg_type, va);
d9577dbd92555b0755881e37724019ef9c578404Stef Walter DEBUG(SSSDBG_CRIT_FAILURE, "Couldn't build DBus message\n");
d9577dbd92555b0755881e37724019ef9c578404Stef Walterint sbus_request_fail_and_finish(struct sbus_request *dbus_req,
d9577dbd92555b0755881e37724019ef9c578404Stef Walter reply = dbus_message_new_error(dbus_req->message, error->name, error->message);
d9577dbd92555b0755881e37724019ef9c578404Stef Walter DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory allocating DBus message\n");