1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-23 00:23:53 +03:00

added filename to error_packet()

This commit is contained in:
Andrew Tridgell
-
parent 9bae57cfe3
commit 2c424788de
2 changed files with 12 additions and 11 deletions

View File

@@ -135,12 +135,12 @@
/* these are the datagram types */ /* these are the datagram types */
#define DGRAM_DIRECT_UNIQUE 0x10 #define DGRAM_DIRECT_UNIQUE 0x10
#define ERROR_DOS(class,code) error_packet(outbuf,NT_STATUS_OK,class,code,__LINE__) #define ERROR_DOS(class,code) error_packet(outbuf,NT_STATUS_OK,class,code,__LINE__,__FILE__)
#define ERROR_NT(status) error_packet(outbuf,status,0,0,__LINE__) #define ERROR_NT(status) error_packet(outbuf,status,0,0,__LINE__,__FILE__)
#define ERROR_BOTH(status,class,code) error_packet(outbuf,status,class,code,__LINE__) #define ERROR_BOTH(status,class,code) error_packet(outbuf,status,class,code,__LINE__,__FILE__)
/* this is how errors are generated */ /* this is how errors are generated */
#define UNIXERROR(defclass,deferror) unix_error_packet(outbuf,defclass,deferror,__LINE__) #define UNIXERROR(defclass,deferror) unix_error_packet(outbuf,defclass,deferror,__LINE__,__FILE__)
#define SMB_ROUNDUP(x,g) (((x)+((g)-1))&~((g)-1)) #define SMB_ROUNDUP(x,g) (((x)+((g)-1))&~((g)-1))

View File

@@ -62,7 +62,8 @@ struct
/**************************************************************************** /****************************************************************************
create an error packet from errno create an error packet from errno
****************************************************************************/ ****************************************************************************/
int unix_error_packet(char *outbuf,int def_class,uint32 def_code,int line) int unix_error_packet(char *outbuf,int def_class,uint32 def_code,
int line, const char *file)
{ {
int eclass=def_class; int eclass=def_class;
int ecode=def_code; int ecode=def_code;
@@ -84,7 +85,7 @@ int unix_error_packet(char *outbuf,int def_class,uint32 def_code,int line)
} }
} }
return error_packet(outbuf,NT_STATUS_OK,eclass,ecode,line); return error_packet(outbuf,NT_STATUS_OK,eclass,ecode,line,file);
} }
@@ -92,7 +93,7 @@ int unix_error_packet(char *outbuf,int def_class,uint32 def_code,int line)
create an error packet. Normally called using the ERROR() macro create an error packet. Normally called using the ERROR() macro
****************************************************************************/ ****************************************************************************/
int error_packet(char *outbuf,NTSTATUS ntstatus, int error_packet(char *outbuf,NTSTATUS ntstatus,
uint8 eclass,uint32 ecode,int line) uint8 eclass,uint32 ecode,int line, const char *file)
{ {
int outsize = set_message(outbuf,0,0,True); int outsize = set_message(outbuf,0,0,True);
extern uint32 global_client_caps; extern uint32 global_client_caps;
@@ -106,8 +107,8 @@ int error_packet(char *outbuf,NTSTATUS ntstatus,
} }
SIVAL(outbuf,smb_rcls,NT_STATUS_V(ntstatus)); SIVAL(outbuf,smb_rcls,NT_STATUS_V(ntstatus));
SSVAL(outbuf,smb_flg2, SVAL(outbuf,smb_flg2)|FLAGS2_32_BIT_ERROR_CODES); SSVAL(outbuf,smb_flg2, SVAL(outbuf,smb_flg2)|FLAGS2_32_BIT_ERROR_CODES);
DEBUG(3,("error packet at line %d cmd=%d (%s) %s\n", DEBUG(3,("error packet at %s(%d) cmd=%d (%s) %s\n",
line, file, line,
(int)CVAL(outbuf,smb_com), (int)CVAL(outbuf,smb_com),
smb_fn_name(CVAL(outbuf,smb_com)), smb_fn_name(CVAL(outbuf,smb_com)),
get_nt_error_msg(ntstatus))); get_nt_error_msg(ntstatus)));
@@ -122,8 +123,8 @@ int error_packet(char *outbuf,NTSTATUS ntstatus,
SSVAL(outbuf,smb_rcls,eclass); SSVAL(outbuf,smb_rcls,eclass);
SSVAL(outbuf,smb_err,ecode); SSVAL(outbuf,smb_err,ecode);
DEBUG(3,("error packet at line %d cmd=%d (%s) eclass=%d ecode=%d\n", DEBUG(3,("error packet at %s(%d) cmd=%d (%s) eclass=%d ecode=%d\n",
line, file, line,
(int)CVAL(outbuf,smb_com), (int)CVAL(outbuf,smb_com),
smb_fn_name(CVAL(outbuf,smb_com)), smb_fn_name(CVAL(outbuf,smb_com)),
eclass, eclass,