summaryrefslogtreecommitdiff
path: root/server/nss/nsssrv.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2009-02-24 14:53:31 -0500
committerSimo Sorce <idra@samba.org>2009-02-24 16:39:51 -0500
commit3621d86ad205dcacb50022f8e6b669218600257f (patch)
tree039418120ac2786e566e80c9d269664286a33eb7 /server/nss/nsssrv.c
parentc14486feb47672a3562989ddb00653f58357e368 (diff)
downloadsssd-3621d86ad205dcacb50022f8e6b669218600257f.tar.gz
sssd-3621d86ad205dcacb50022f8e6b669218600257f.tar.bz2
sssd-3621d86ad205dcacb50022f8e6b669218600257f.zip
Revert "Fixing serious memory allocation bug in sbus_message_handler."
This reverts commit 13421cbe0af4343f9d110600755ffa756690b282. Conflicts: server/infopipe/infopipe.c server/infopipe/infopipe.h While this solution fixed the contingent memory problem it introduced other problems in handling asynchronous replies. Reverting in preparation for a different way to solve it. Conflicts have been taken care of.
Diffstat (limited to 'server/nss/nsssrv.c')
-rw-r--r--server/nss/nsssrv.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/server/nss/nsssrv.c b/server/nss/nsssrv.c
index 0909f629..b6191cce 100644
--- a/server/nss/nsssrv.c
+++ b/server/nss/nsssrv.c
@@ -44,9 +44,9 @@
#define SSS_NSS_PIPE_NAME "nss"
-static int service_identity(DBusMessage *message, struct sbus_message_ctx *reply);
-static int service_pong(DBusMessage *message, struct sbus_message_ctx *reply);
-static int service_reload(DBusMessage *message, struct sbus_message_ctx *reply);
+static int service_identity(DBusMessage *message, void *data, DBusMessage **r);
+static int service_pong(DBusMessage *message, void *data, DBusMessage **r);
+static int service_reload(DBusMessage *message, void *data, DBusMessage **r);
static int nss_init_domains(struct nss_ctx *nctx);
static int _domain_comparator(const void *key1, const void *key2);
@@ -227,17 +227,18 @@ static void accept_fd_handler(struct event_context *ev,
return;
}
-static int service_identity(DBusMessage *message, struct sbus_message_ctx *reply)
+static int service_identity(DBusMessage *message, void *data, DBusMessage **r)
{
dbus_uint16_t version = NSS_SBUS_SERVICE_VERSION;
- const char *name = NSS_SBUS_SERVICE_NAME;\
+ const char *name = NSS_SBUS_SERVICE_NAME;
+ DBusMessage *reply;
dbus_bool_t ret;
DEBUG(4,("Sending ID reply: (%s,%d)\n",
name, version));
- reply->reply_message = dbus_message_new_method_return(message);
- ret = dbus_message_append_args(reply->reply_message,
+ reply = dbus_message_new_method_return(message);
+ ret = dbus_message_append_args(reply,
DBUS_TYPE_STRING, &name,
DBUS_TYPE_UINT16, &version,
DBUS_TYPE_INVALID);
@@ -245,30 +246,33 @@ static int service_identity(DBusMessage *message, struct sbus_message_ctx *reply
return EIO;
}
+ *r = reply;
return EOK;
}
-static int service_pong(DBusMessage *message, struct sbus_message_ctx *reply)
+static int service_pong(DBusMessage *message, void *data, DBusMessage **r)
{
+ DBusMessage *reply;
dbus_bool_t ret;
- reply->reply_message = dbus_message_new_method_return(message);
- ret = dbus_message_append_args(reply->reply_message, DBUS_TYPE_INVALID);
+ reply = dbus_message_new_method_return(message);
+ ret = dbus_message_append_args(reply, DBUS_TYPE_INVALID);
if (!ret) {
return EIO;
}
+ *r = reply;
return EOK;
}
-static int service_reload(DBusMessage *message, struct sbus_message_ctx *reply) {
+static int service_reload(DBusMessage *message, void *data, DBusMessage **r) {
/* Monitor calls this function when we need to reload
* our configuration information. Perform whatever steps
* are needed to update the configuration objects.
*/
/* Send an empty reply to acknowledge receipt */
- return service_pong(message, reply);
+ return service_pong(message, data, r);
}
static int nss_sbus_init(struct nss_ctx *nctx)