summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-08-05 11:19:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:29:20 -0500
commitd274724ebbbce15abe2c5cd73fca94453dfc2a84 (patch)
tree12c0dbbf72bdff12a3b3bc5d83682e56366a6e2c /source3
parent43a77ab149f154961113f05296815af50c0274da (diff)
downloadsamba-d274724ebbbce15abe2c5cd73fca94453dfc2a84.tar.gz
samba-d274724ebbbce15abe2c5cd73fca94453dfc2a84.tar.bz2
samba-d274724ebbbce15abe2c5cd73fca94453dfc2a84.zip
r24243: Remove reply_prep_legacy from api_reply
(This used to be commit b01664b43b0bd94bb59dec57480d2be954a7298a)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/ipc.c18
-rw-r--r--source3/smbd/lanman.c38
2 files changed, 20 insertions, 36 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index 3b26ded71f..f865af2fc7 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -375,20 +375,10 @@ static void named_pipe(connection_struct *conn, uint16 vuid,
DEBUG(3,("named pipe command on <%s> name\n", name));
if (strequal(name,"LANMAN")) {
- char *inbuf, *outbuf;
- int size, bufsize;
-
- if (!reply_prep_legacy(req, &inbuf, &outbuf, &size, &bufsize)) {
- reply_nterror(req, NT_STATUS_NO_MEMORY);
- return;
- }
-
- reply_post_legacy(
- req,
- api_reply(conn, vuid, inbuf, outbuf,
- data, params,
- tdscnt, tpscnt,
- mdrcnt, mprcnt));
+ api_reply(conn, vuid, req,
+ data, params,
+ tdscnt, tpscnt,
+ mdrcnt, mprcnt);
return;
}
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index f7a4f9b0bd..3673998f79 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -4366,16 +4366,11 @@ static const struct {
Handle remote api calls.
****************************************************************************/
-int api_reply(connection_struct *conn,
- uint16 vuid,
- const char *inbuf,
- char *outbuf,
- char *data,
- char *params,
- int tdscnt,
- int tpscnt,
- int mdrcnt,
- int mprcnt)
+void api_reply(connection_struct *conn, uint16 vuid,
+ struct smb_request *req,
+ char *data, char *params,
+ int tdscnt, int tpscnt,
+ int mdrcnt, int mprcnt)
{
int api_command;
char *rdata = NULL;
@@ -4389,11 +4384,13 @@ int api_reply(connection_struct *conn,
if (!params) {
DEBUG(0,("ERROR: NULL params in api_reply()\n"));
- return 0;
+ reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+ return;
}
if (tpscnt < 2) {
- return 0;
+ reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+ return;
}
api_command = SVAL(params,0);
/* Is there a string at position params+2 ? */
@@ -4426,7 +4423,8 @@ int api_reply(connection_struct *conn,
user_struct *user = get_valid_user_struct(vuid);
if (!user || user->guest) {
- return ERROR_NT(NT_STATUS_ACCESS_DENIED);
+ reply_nterror(req, NT_STATUS_ACCESS_DENIED);
+ return;
}
}
@@ -4444,7 +4442,8 @@ int api_reply(connection_struct *conn,
DEBUG(0,("api_reply: malloc fail !\n"));
SAFE_FREE(rdata);
SAFE_FREE(rparam);
- return -1;
+ reply_nterror(req, NT_STATUS_NO_MEMORY);
+ return;
}
reply = api_commands[i].fn(conn,
@@ -4468,16 +4467,11 @@ int api_reply(connection_struct *conn,
/* If api_Unsupported returns false we can't return anything. */
if (reply) {
- send_trans_reply(inbuf,
- outbuf,
- rparam,
- rparam_len,
- rdata,
- rdata_len,
- False);
+ send_trans_reply_new(req, rparam, rparam_len,
+ rdata, rdata_len, False);
}
SAFE_FREE(rdata);
SAFE_FREE(rparam);
- return -1;
+ return;
}