{
union smb_tcon con;
NTSTATUS status;
- char *p;
+ uint8_t *p;
/* parse request */
REQ_CHECK_WCT(req, 0);
{
NTSTATUS status;
union smb_tcon con;
- char *p;
+ uint8_t *p;
uint16_t passlen;
con.tconx.level = RAW_TCON_TCONX;
REQ_CHECK_WCT(req, 3);
REQ_TALLOC(oi, sizeof(*oi));
- oi->mknew.level = RAW_OPEN_MKNEW;
+ if (CVAL(req->in.hdr, HDR_COM) == SMBmknew) {
+ oi->mknew.level = RAW_OPEN_MKNEW;
+ } else {
+ oi->mknew.level = RAW_OPEN_CREATE;
+ }
oi->mknew.in.attrib = SVAL(req->in.vwv, VWV(0));
oi->mknew.in.write_time = srv_pull_dos_date3(req->smb_conn, req->in.vwv + VWV(1));
SSVAL(req->out.vwv, VWV(0), oi->ctemp.out.fnum);
/* the returned filename is relative to the directory */
- req_push_str(req, NULL, oi->ctemp.out.name, -1, STR_TERMINATE);
+ req_push_str(req, NULL, oi->ctemp.out.name, -1, STR_TERMINATE | STR_ASCII);
req_send_reply(req);
}
io->readx.in.offset = IVAL(req->in.vwv, VWV(3));
io->readx.in.maxcnt = SVAL(req->in.vwv, VWV(5));
io->readx.in.mincnt = SVAL(req->in.vwv, VWV(6));
- io->readx.in.maxcnt |= IVAL(req->in.vwv, VWV(7)) << 16;
io->readx.in.remaining = SVAL(req->in.vwv, VWV(9));
+
+ if (req->smb_conn->negotiate.client_caps & CAP_LARGE_READX) {
+ uint32_t high_part = IVAL(req->in.vwv, VWV(7));
+ if (high_part == 1) {
+ io->readx.in.maxcnt |= high_part << 16;
+ }
+ }
/* the 64 bit variant */
if (req->in.wct == 12) {
void reply_mv(struct smbsrv_request *req)
{
union smb_rename *io;
- char *p;
+ uint8_t *p;
/* parse the request */
REQ_CHECK_WCT(req, 1);
void reply_ntrename(struct smbsrv_request *req)
{
union smb_rename *io;
- char *p;
+ uint8_t *p;
/* parse the request */
REQ_CHECK_WCT(req, 4);
void reply_copy(struct smbsrv_request *req)
{
struct smb_copy *cp;
- char *p;
+ uint8_t *p;
/* parse request */
REQ_CHECK_WCT(req, 3);
union smb_lock *lck;
uint_t total_locks, i;
uint_t lck_size;
- char *p;
+ uint8_t *p;
/* parse request */
REQ_CHECK_WCT(req, 8);
****************************************************************************/
void reply_writebmpx(struct smbsrv_request *req)
{
- /* we will need to implement this one for OS/2, but right now I can't be bothered */
- req_reply_error(req, NT_STATUS_FOOBAR);
+ req_reply_dos_error(req, ERRSRV, ERRuseSTD);
}
****************************************************************************/
void reply_writebs(struct smbsrv_request *req)
{
- /* see reply_writebmpx */
- req_reply_error(req, NT_STATUS_FOOBAR);
+ req_reply_dos_error(req, ERRSRV, ERRuseSTD);
}
{
NTSTATUS status;
union smb_sesssetup sess;
- char *p;
+ uint8_t *p;
uint16_t passlen;
sess.old.level = RAW_SESSSETUP_OLD;
{
NTSTATUS status;
union smb_sesssetup sess;
- char *p;
+ uint8_t *p;
uint16_t passlen1, passlen2;
sess.nt1.level = RAW_SESSSETUP_NT1;
{
NTSTATUS status;
union smb_sesssetup sess;
- char *p;
+ uint8_t *p;
uint16_t blob_len;
sess.spnego.level = RAW_SESSSETUP_SPNEGO;
io->ntcreatex.in.create_options = IVAL(req->in.vwv, 39);
io->ntcreatex.in.impersonation = IVAL(req->in.vwv, 43);
io->ntcreatex.in.security_flags = CVAL(req->in.vwv, 47);
+ io->ntcreatex.in.ea_list = NULL;
+ io->ntcreatex.in.sec_desc = NULL;
/* we need a neater way to handle this alignment */
if ((req->flags2 & FLAGS2_UNICODE_STRINGS) &&
****************************************************************************/
void reply_ntcancel(struct smbsrv_request *req)
{
- req_reply_error(req, NT_STATUS_FOOBAR);
+ /* NOTE: this request does not generate a reply */
+ req_signing_no_reply(req);
+ ntvfs_cancel(req);
+ req_destroy(req);
}
/****************************************************************************
void reply_special(struct smbsrv_request *req)
{
uint8_t msg_type;
- char buf[4];
+ uint8_t *buf = talloc_zero_array_p(req, uint8_t, 4);
msg_type = CVAL(req->in.buffer,0);
switch (msg_type) {
case 0x81: /* session request */
if (req->smb_conn->negotiate.done_nbt_session) {
- smbsrv_terminate_connection(req->smb_conn, "multiple session request not permitted");
+ DEBUG(0,("Warning: ignoring secondary session request\n"));
+ return;
}
SCVAL(buf,0,0x82);
SCVAL(buf,3,0);
DEBUG(0,("REWRITE: not parsing netbios names in NBT session request!\n"));
- /* TODO: store the name for the session setup 'remote machine' code, as well as smbstatus */
+ /* TODO: store the name for the session setup 'remote
+ machine' code, as well as smbstatus */
req->smb_conn->negotiate.done_nbt_session = True;