/* * smbrdr_send * * Send the SMB packet pointed by the given handle over * network. * * Returns: * * NT_STATUS_INTERNAL_ERROR crypto framework failure * NT_STATUS_UNEXPECTED_NETWORK_ERROR send failed * NT_STATUS_SUCCESS successful */ DWORD smbrdr_send(smbrdr_handle_t *srh) { int rc; if (smbrdr_sign(&srh->srh_session->sign_ctx, &srh->srh_mbuf) != SMBAUTH_SUCCESS) { smb_log(smbrdr_log_hdl, LOG_ERR, "smbrdr_send[%d]: signing failed", srh->srh_cmd); return (NT_STATUS_INTERNAL_ERROR); } rc = nb_send(srh->srh_session->sock, srh->srh_buf, smb_msgbuf_used(&srh->srh_mbuf)); if (rc < 0) { /* * Make the sequence number of the next SMB request even * to avoid DC from failing the next SMB request with * ACCESS_DENIED. */ smb_mac_dec_seqnum(&srh->srh_session->sign_ctx); smb_log(smbrdr_log_hdl, LOG_ERR, "smbrdr_send[%d]: send failed (%d)", srh->srh_cmd, rc); return (NT_STATUS_UNEXPECTED_NETWORK_ERROR); } return (NT_STATUS_SUCCESS); }
/* WarFTP |->âABOR |<-226 Transfer complete. 39600000 bytes in 18.84 sec. (2052.974 Kb/s) |<-225 ABOR command successful. FreeBSD, SunOS |->òABOR |<-426 Transfer aborted. Data connection closed. |<-226 Abort successful QNX |->âABOR |<-226 Transfer complete. |<-225 ABOR command successful. IIS |->âABOR |<-225 ABOR command successful. QNX |->òABOR |<-452 Error writing file: No child processes. |<-225 ABOR command successful. GuildFTP (have no ABOR notify at all) -> <ABORT> <- 226 Transfer complete. 11200000 bytes in 2 sec. (5600.00 Kb/s). ?? ->òABOR <-450 Transfer aborted. Link to file server lost. <-500 ÿôÿòABOR not understood */ BOOL Connection::SendAbort(SOCKET din) { do { if(!fprintfSocket(cout,"%c%c",ffIAC,ffIP)) { Log(("!send ffIAC")); break; } char msg = ffIAC; /* send ffIAC in urgent mode instead of DM because UNIX places oob mark */ /* after urgent byte rather than before as now is protocol */ if(nb_send(&cout,&msg,1,MSG_OOB) != 1) { Log(("rr: !send urgent")); break; } if(!fprintfSocket(cout,"%cABOR\r\n",ffDM)) { Log(("!send ABOR")); break; } scClose(data_peer,-1); int res; Log(("Wait ABOT reply")); res = getreply(FALSE); if(res == RPL_TIMEOUT) { Log(("Error waiting first ABOR reply")); return FALSE; } //Single line if(code == 225) { Log(("Single line ABOR reply")); return TRUE; } else //Wait OPTIONAL second line if(code == 226) { Log(("Wait OPT second reply")); do { res = getreply(FALSE,500); if(res == RPL_TIMEOUT) { Log(("Timeout: res: %d, code: %d", res, code)); return TRUE; } else if(res == RPL_ERROR) { Log(("Error: res: %d, code: %d", res, code)); return FALSE; } Log(("Result: res: %d, code: %d", res, code)); } while(true); } else { //Wait second line Log(("Wait second reply")); res = getreply(FALSE); if(res == RPL_TIMEOUT) { Log(("Error waiting second ABOR reply")); return FALSE; } Log(("Second reply: res: %d, code: %d", res,code)); return TRUE; } } while(0); /*Error sending ABOR*/ return FALSE; }