diff options
Diffstat (limited to 'source3/smbd/lanman.c')
-rw-r--r-- | source3/smbd/lanman.c | 38 |
1 files changed, 16 insertions, 22 deletions
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; } |