関数 | |
int | cached_error_packet (char *outbuf, files_struct *fsp, int line, const char *file) |
int | unix_error_packet (char *outbuf, int def_class, uint32 def_code, NTSTATUS def_status, int line, const char *file) |
BOOL | use_nt_status (void) |
void | error_packet_set (char *outbuf, uint8 eclass, uint32 ecode, NTSTATUS ntstatus, int line, const char *file) |
int | error_packet (char *outbuf, uint8 eclass, uint32 ecode, NTSTATUS ntstatus, int line, const char *file) |
int | error_open (char *outbuf, NTSTATUS status, int line, const char *file) |
変数 | |
unix_error_map | unix_dos_nt_errmap [] |
uint32 | global_client_caps |
int cached_error_packet | ( | char * | outbuf, | |
files_struct * | fsp, | |||
int | line, | |||
const char * | file | |||
) |
参照先 err・error_packet()・ntstatus・files_struct::wbmpx_ptr・write_bmpx_struct::wr_errclass・write_bmpx_struct::wr_error・write_bmpx_struct::wr_status.
00033 { 00034 write_bmpx_struct *wbmpx = fsp->wbmpx_ptr; 00035 int32 eclass = wbmpx->wr_errclass; 00036 int32 err = wbmpx->wr_error; 00037 NTSTATUS ntstatus = wbmpx->wr_status; 00038 00039 /* We can now delete the auxiliary struct */ 00040 SAFE_FREE(fsp->wbmpx_ptr); 00041 return error_packet(outbuf,eclass,err,ntstatus,line,file); 00042 }
int unix_error_packet | ( | char * | outbuf, | |
int | def_class, | |||
uint32 | def_code, | |||
NTSTATUS | def_status, | |||
int | line, | |||
const char * | file | |||
) |
参照先 unix_error_map::dos_class・dos_class・unix_error_map::dos_code・errno・error_packet()・unix_error_map::nt_error・ntstatus・strerror()・unix_dos_nt_errmap・unix_error_map::unix_error.
00049 { 00050 int eclass=def_class; 00051 int ecode=def_code; 00052 NTSTATUS ntstatus = def_status; 00053 int i=0; 00054 00055 if (errno != 0) { 00056 DEBUG(3,("unix_error_packet: error string = %s\n",strerror(errno))); 00057 00058 while (unix_dos_nt_errmap[i].dos_class != 0) { 00059 if (unix_dos_nt_errmap[i].unix_error == errno) { 00060 eclass = unix_dos_nt_errmap[i].dos_class; 00061 ecode = unix_dos_nt_errmap[i].dos_code; 00062 ntstatus = unix_dos_nt_errmap[i].nt_error; 00063 break; 00064 } 00065 i++; 00066 } 00067 } 00068 00069 return error_packet(outbuf,eclass,ecode,ntstatus,line,file); 00070 }
BOOL use_nt_status | ( | void | ) |
参照先 global_client_caps.
参照元 open_file_ntcreate()・reply_mkdir().
00073 { 00074 return lp_nt_status_support() && (global_client_caps & CAP_STATUS32); 00075 }
void error_packet_set | ( | char * | outbuf, | |
uint8 | eclass, | |||
uint32 | ecode, | |||
NTSTATUS | ntstatus, | |||
int | line, | |||
const char * | file | |||
) |
参照先 dos_to_ntstatus()・global_client_caps・nt_errstr()・ntstatus・ntstatus_to_dos()・smb_fn_name().
参照元 error_packet()・send_trans2_replies().
00085 { 00086 BOOL force_nt_status = False; 00087 BOOL force_dos_status = False; 00088 00089 if (eclass == (uint8)-1) { 00090 force_nt_status = True; 00091 } else if (NT_STATUS_IS_DOS(ntstatus)) { 00092 force_dos_status = True; 00093 } 00094 00095 if (force_nt_status || (!force_dos_status && lp_nt_status_support() && (global_client_caps & CAP_STATUS32))) { 00096 /* We're returning an NT error. */ 00097 if (NT_STATUS_V(ntstatus) == 0 && eclass) { 00098 ntstatus = dos_to_ntstatus(eclass, ecode); 00099 } 00100 SIVAL(outbuf,smb_rcls,NT_STATUS_V(ntstatus)); 00101 SSVAL(outbuf,smb_flg2, SVAL(outbuf,smb_flg2)|FLAGS2_32_BIT_ERROR_CODES); 00102 DEBUG(3,("error packet at %s(%d) cmd=%d (%s) %s\n", 00103 file, line, 00104 (int)CVAL(outbuf,smb_com), 00105 smb_fn_name(CVAL(outbuf,smb_com)), 00106 nt_errstr(ntstatus))); 00107 } else { 00108 /* We're returning a DOS error only. */ 00109 if (NT_STATUS_IS_DOS(ntstatus)) { 00110 eclass = NT_STATUS_DOS_CLASS(ntstatus); 00111 ecode = NT_STATUS_DOS_CODE(ntstatus); 00112 } else if (eclass == 0 && NT_STATUS_V(ntstatus)) { 00113 ntstatus_to_dos(ntstatus, &eclass, &ecode); 00114 } 00115 00116 SSVAL(outbuf,smb_flg2, SVAL(outbuf,smb_flg2)&~FLAGS2_32_BIT_ERROR_CODES); 00117 SSVAL(outbuf,smb_rcls,eclass); 00118 SSVAL(outbuf,smb_err,ecode); 00119 00120 DEBUG(3,("error packet at %s(%d) cmd=%d (%s) eclass=%d ecode=%d\n", 00121 file, line, 00122 (int)CVAL(outbuf,smb_com), 00123 smb_fn_name(CVAL(outbuf,smb_com)), 00124 eclass, 00125 ecode)); 00126 } 00127 }
int error_packet | ( | char * | outbuf, | |
uint8 | eclass, | |||
uint32 | ecode, | |||
NTSTATUS | ntstatus, | |||
int | line, | |||
const char * | file | |||
) |
参照先 error_packet_set()・ntstatus・set_message().
参照元 cached_error_packet()・error_open()・unix_error_packet().
00130 { 00131 int outsize = set_message(outbuf,0,0,True); 00132 error_packet_set(outbuf, eclass, ecode, ntstatus, line, file); 00133 return outsize; 00134 }
int error_open | ( | char * | outbuf, | |
NTSTATUS | status, | |||
int | line, | |||
const char * | file | |||
) |
参照先 error_packet()・status.
00141 { 00142 if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) { 00143 /* 00144 * We hit an existing file, and if we're returning DOS 00145 * error codes OBJECT_NAME_COLLISION would map to 00146 * ERRDOS/183, we need to return ERRDOS/80, see bug 00147 * 4852. 00148 */ 00149 return error_packet(outbuf, ERRDOS, ERRfilexists, 00150 NT_STATUS_OBJECT_NAME_COLLISION, line, file); 00151 } 00152 return error_packet(outbuf,0,0,status,line,file); 00153 }
struct unix_error_map unix_dos_nt_errmap[] |
uint32 global_client_caps |