diff options
author | Simo Sorce <idra@samba.org> | 2009-02-24 16:36:16 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2009-02-24 16:50:08 -0500 |
commit | 57df88bb0b4ce656855410a8c2969d93475c2f11 (patch) | |
tree | 644bf0ce008c446efc27cf369d18a248da5ae7b4 /server/infopipe/infopipe_groups.c | |
parent | 3621d86ad205dcacb50022f8e6b669218600257f (diff) | |
download | sssd-57df88bb0b4ce656855410a8c2969d93475c2f11.tar.gz sssd-57df88bb0b4ce656855410a8c2969d93475c2f11.tar.bz2 sssd-57df88bb0b4ce656855410a8c2969d93475c2f11.zip |
Proper fix for memory handling problem.
sbus_message_handler is not responsible anymore for sending
back data in any case.
Transfer this responsibility to the handler function called.
This way both synchronous and asynchronous funstions use the
interface the same way and can properly free memory referenced
by the reply after the send buffer has been filled in and all
copies are done in sbus_conn_send_reply()
Diffstat (limited to 'server/infopipe/infopipe_groups.c')
-rw-r--r-- | server/infopipe/infopipe_groups.c | 55 |
1 files changed, 45 insertions, 10 deletions
diff --git a/server/infopipe/infopipe_groups.c b/server/infopipe/infopipe_groups.c index 4b9cfc22..7ec85296 100644 --- a/server/infopipe/infopipe_groups.c +++ b/server/infopipe/infopipe_groups.c @@ -23,32 +23,67 @@ #include "util/util.h" #include "infopipe.h" -int infp_groups_create(DBusMessage *message, void *data, DBusMessage **r) +int infp_groups_create(DBusMessage *message, struct sbus_conn_ctx *sconn) { - *r = dbus_message_new_error(message, DBUS_ERROR_NOT_SUPPORTED, "Not yet implemented"); + DBusMessage *reply; + + reply = dbus_message_new_error(message, DBUS_ERROR_NOT_SUPPORTED, "Not yet implemented"); + + /* send reply */ + sbus_conn_send_reply(sconn, reply); + + dbus_message_unref(reply); return EOK; } -int infp_groups_delete(DBusMessage *message, void *data, DBusMessage **r) +int infp_groups_delete(DBusMessage *message, struct sbus_conn_ctx *sconn) { - *r = dbus_message_new_error(message, DBUS_ERROR_NOT_SUPPORTED, "Not yet implemented"); + DBusMessage *reply; + + reply = dbus_message_new_error(message, DBUS_ERROR_NOT_SUPPORTED, "Not yet implemented"); + + /* send reply */ + sbus_conn_send_reply(sconn, reply); + + dbus_message_unref(reply); return EOK; } -int infp_groups_add_members(DBusMessage *message, void *data, DBusMessage **r) +int infp_groups_add_members(DBusMessage *message, struct sbus_conn_ctx *sconn) { - *r = dbus_message_new_error(message, DBUS_ERROR_NOT_SUPPORTED, "Not yet implemented"); + DBusMessage *reply; + + reply = dbus_message_new_error(message, DBUS_ERROR_NOT_SUPPORTED, "Not yet implemented"); + + /* send reply */ + sbus_conn_send_reply(sconn, reply); + + dbus_message_unref(reply); return EOK; } -int infp_groups_remove_members(DBusMessage *message, void *data, DBusMessage **r) +int infp_groups_remove_members(DBusMessage *message, struct sbus_conn_ctx *sconn) { - *r = dbus_message_new_error(message, DBUS_ERROR_NOT_SUPPORTED, "Not yet implemented"); + DBusMessage *reply; + + reply = dbus_message_new_error(message, DBUS_ERROR_NOT_SUPPORTED, "Not yet implemented"); + + /* send reply */ + sbus_conn_send_reply(sconn, reply); + + dbus_message_unref(reply); return EOK; } -int infp_groups_set_gid(DBusMessage *message, void *data, DBusMessage **r) +int infp_groups_set_gid(DBusMessage *message, struct sbus_conn_ctx *sconn) { - *r = dbus_message_new_error(message, DBUS_ERROR_NOT_SUPPORTED, "Not yet implemented"); + DBusMessage *reply; + + reply = dbus_message_new_error(message, DBUS_ERROR_NOT_SUPPORTED, "Not yet implemented"); + + /* send reply */ + sbus_conn_send_reply(sconn, reply); + + dbus_message_unref(reply); return EOK; } |