summaryrefslogtreecommitdiff
path: root/source/smbd/lanman.c
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
commitb01664b43b0bd94bb59dec57480d2be954a7298a (patch)
tree6f9280bde4aaae2dcbd08bbca5b18617b5e33e16 /source/smbd/lanman.c
parent160f65946af9b3e1609b0efb211edc81514fb36f (diff)
downloadsamba-b01664b43b0bd94bb59dec57480d2be954a7298a.tar.gz
r24243: Remove reply_prep_legacy from api_reply
Diffstat (limited to 'source/smbd/lanman.c')
-rw-r--r--source/smbd/lanman.c38
1 files changed, 16 insertions, 22 deletions
diff --git a/source/smbd/lanman.c b/source/smbd/lanman.c
index f7a4f9b0bde..3673998f798 100644
--- a/source/smbd/lanman.c
+++ b/source/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;
}