From a5f412f305ea2bdb0ee0efd5a38385525d4671c8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 10 Aug 2007 10:28:09 +0000 Subject: r24311: add a reply_force_nterror() macro metze (This used to be commit b9ae00f4980c305f2f7334b139f9bc72fd9afbd6) --- source3/include/smb_macros.h | 1 + source3/smbd/error.c | 8 ++++++++ 2 files changed, 9 insertions(+) (limited to 'source3') diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 15789a938a..7c786b03c8 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -170,6 +170,7 @@ #define ERROR_BOTH(status,class,code) error_packet(inbuf,outbuf,class,code,status,__LINE__,__FILE__) #define reply_nterror(req,status) reply_nt_error(req,status,__LINE__,__FILE__) +#define reply_force_nterror(req,status) reply_force_nt_error(req,status,__LINE__,__FILE__) #define reply_doserror(req,eclass,ecode) reply_dos_error(req,eclass,ecode,__LINE__,__FILE__) #define reply_botherror(req,status,eclass,ecode) reply_both_error(req,eclass,ecode,status,__LINE__,__FILE__) #define reply_unixerror(req,defclass,deferror) reply_unix_error(req,defclass,deferror,NT_STATUS_OK,__LINE__,__FILE__) diff --git a/source3/smbd/error.c b/source3/smbd/error.c index 023e1b7dcc..dd9ff85640 100644 --- a/source3/smbd/error.c +++ b/source3/smbd/error.c @@ -140,6 +140,14 @@ void reply_nt_error(struct smb_request *req, NTSTATUS ntstatus, error_packet_set((char *)req->outbuf, 0, 0, ntstatus, line, file); } +void reply_force_nt_error(struct smb_request *req, NTSTATUS ntstatus, + int line, const char *file) +{ + TALLOC_FREE(req->outbuf); + reply_outbuf(req, 0, 0); + error_packet_set((char *)req->outbuf, -1, -1, ntstatus, line, file); +} + void reply_dos_error(struct smb_request *req, uint8 eclass, uint32 ecode, int line, const char *file) { -- cgit