summaryrefslogtreecommitdiffstats
path: root/source/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-01-11 19:10:25 +0000
committerJeremy Allison <jra@samba.org>2002-01-11 19:10:25 +0000
commit01ff6ce4963e1daff019f2b936cef218e1c93f67 (patch)
treecc0f4705076a09781bb9365d56e1bd5f56a59d6e /source/smbd
parent0b0b937b58f4bf4e005fb622f0db19175fc46a47 (diff)
downloadsamba-01ff6ce4963e1daff019f2b936cef218e1c93f67.tar.gz
samba-01ff6ce4963e1daff019f2b936cef218e1c93f67.tar.xz
samba-01ff6ce4963e1daff019f2b936cef218e1c93f67.zip
Same fix as went into 2.2 (I'm waiting for jerry to finish some code).
Jeremy.
Diffstat (limited to 'source/smbd')
-rw-r--r--source/smbd/lanman.c16
-rw-r--r--source/smbd/negprot.c2
-rw-r--r--source/smbd/process.c14
-rw-r--r--source/smbd/reply.c68
-rw-r--r--source/smbd/trans2.c10
5 files changed, 55 insertions, 55 deletions
diff --git a/source/smbd/lanman.c b/source/smbd/lanman.c
index 64da736ae2e..fb8b52342ac 100644
--- a/source/smbd/lanman.c
+++ b/source/smbd/lanman.c
@@ -1512,7 +1512,7 @@ static int fill_share_info(connection_struct *conn, int snum, int uLevel,
if (uLevel > 0)
{
int type;
- CVAL(p,13) = 0;
+ SCVAL(p,13,0);
type = STYPE_DISKTREE;
if (lp_print_ok(snum)) type = STYPE_PRINTQ;
if (strequal("IPC",lp_fstype(snum))) type = STYPE_IPC;
@@ -1894,16 +1894,16 @@ static BOOL api_NetRemoteTOD(connection_struct *conn,uint16 vuid, char *param,ch
t = LocalTime(&unixdate);
SIVAL(p,4,0); /* msecs ? */
- CVAL(p,8) = t->tm_hour;
- CVAL(p,9) = t->tm_min;
- CVAL(p,10) = t->tm_sec;
- CVAL(p,11) = 0; /* hundredths of seconds */
+ SCVAL(p,8,t->tm_hour);
+ SCVAL(p,9,t->tm_min);
+ SCVAL(p,10,t->tm_sec);
+ SCVAL(p,11,0); /* hundredths of seconds */
SSVALS(p,12,TimeDiff(unixdate)/60); /* timezone in minutes from GMT */
SSVAL(p,14,10000); /* timer interval in 0.0001 of sec */
- CVAL(p,16) = t->tm_mday;
- CVAL(p,17) = t->tm_mon + 1;
+ SCVAL(p,16,t->tm_mday);
+ SCVAL(p,17,t->tm_mon + 1);
SSVAL(p,18,1900+t->tm_year);
- CVAL(p,20) = t->tm_wday;
+ SCVAL(p,20,t->tm_wday);
}
diff --git a/source/smbd/negprot.c b/source/smbd/negprot.c
index 81f035f3b67..5899f0af52b 100644
--- a/source/smbd/negprot.c
+++ b/source/smbd/negprot.c
@@ -269,7 +269,7 @@ static int reply_nt1(char *inbuf, char *outbuf)
set_message(outbuf,17,0,True);
- CVAL(outbuf,smb_vwv1) = secword;
+ SCVAL(outbuf,smb_vwv1,secword);
Protocol = PROTOCOL_NT1;
diff --git a/source/smbd/process.c b/source/smbd/process.c
index ff53acbd9ee..b1fcf864e11 100644
--- a/source/smbd/process.c
+++ b/source/smbd/process.c
@@ -914,11 +914,11 @@ void construct_reply_common(char *inbuf,char *outbuf)
memset(outbuf,'\0',smb_size);
set_message(outbuf,0,0,True);
- CVAL(outbuf,smb_com) = CVAL(inbuf,smb_com);
+ SCVAL(outbuf,smb_com,CVAL(inbuf,smb_com));
memcpy(outbuf+4,inbuf+4,4);
- CVAL(outbuf,smb_rcls) = SMB_SUCCESS;
- CVAL(outbuf,smb_reh) = 0;
+ SCVAL(outbuf,smb_rcls,SMB_SUCCESS);
+ SCVAL(outbuf,smb_reh,0);
SCVAL(outbuf,smb_flg, FLAG_REPLY | (CVAL(inbuf,smb_flg) & FLAG_CASELESS_PATHNAMES));
SSVAL(outbuf,smb_flg2,
FLAGS2_UNICODE_STRINGS | FLAGS2_LONG_PATH_COMPONENTS |
@@ -949,7 +949,7 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize)
/* maybe its not chained */
if (smb_com2 == 0xFF) {
- CVAL(outbuf,smb_vwv0) = 0xFF;
+ SCVAL(outbuf,smb_vwv0,0xFF);
return outsize;
}
@@ -969,7 +969,7 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize)
/* we need to tell the client where the next part of the reply will be */
SSVAL(outbuf,smb_vwv1,smb_offset(outbuf+outsize,outbuf));
- CVAL(outbuf,smb_vwv0) = smb_com2;
+ SCVAL(outbuf,smb_vwv0,smb_com2);
/* remember how much the caller added to the chain, only counting stuff
after the parameter words */
@@ -991,7 +991,7 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize)
memmove(inbuf2,inbuf,smb_wct);
/* create the in buffer */
- CVAL(inbuf2,smb_com) = smb_com2;
+ SCVAL(inbuf2,smb_com,smb_com2);
/* create the out buffer */
construct_reply_common(inbuf2, outbuf2);
@@ -1006,7 +1006,7 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize)
/* copy the new reply and request headers over the old ones, but
preserve the smb_com field */
memmove(orig_outbuf,outbuf2,smb_wct);
- CVAL(orig_outbuf,smb_com) = smb_com1;
+ SCVAL(orig_outbuf,smb_com,smb_com1);
/* restore the saved data, being careful not to overwrite any
data from the reply header */
diff --git a/source/smbd/reply.c b/source/smbd/reply.c
index c67ce357c65..03d0c189424 100644
--- a/source/smbd/reply.c
+++ b/source/smbd/reply.c
@@ -66,8 +66,8 @@ int reply_special(char *inbuf,char *outbuf)
switch (msg_type) {
case 0x81: /* session request */
- CVAL(outbuf,0) = 0x82;
- CVAL(outbuf,3) = 0;
+ SCVAL(outbuf,0,0x82);
+ SCVAL(outbuf,3,0);
if (name_len(inbuf+4) > 50 ||
name_len(inbuf+4 + name_len(inbuf + 4)) > 50) {
DEBUG(0,("Invalid name length in session request\n"));
@@ -100,7 +100,7 @@ int reply_special(char *inbuf,char *outbuf)
if (name_type == 'R') {
/* We are being asked for a pathworks session ---
no thanks! */
- CVAL(outbuf, 0) = 0x83;
+ SCVAL(outbuf, 0,0x83);
break;
}
@@ -120,8 +120,8 @@ int reply_special(char *inbuf,char *outbuf)
case 0x89: /* session keepalive request
(some old clients produce this?) */
- CVAL(outbuf,0) = SMBkeepalive;
- CVAL(outbuf,3) = 0;
+ SCVAL(outbuf,0,SMBkeepalive);
+ SCVAL(outbuf,3,0);
break;
case 0x82: /* positive session response */
@@ -651,7 +651,7 @@ int reply_search(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
if (strlen(directory) == 0)
pstrcpy(directory,"./");
memset((char *)status,'\0',21);
- CVAL(status,0) = dirtype;
+ SCVAL(status,0,dirtype);
}
else
{
@@ -735,7 +735,7 @@ int reply_search(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
if (numentries == 0 || !ok)
{
- CVAL(outbuf,smb_rcls) = ERRDOS;
+ SCVAL(outbuf,smb_rcls,ERRDOS);
SSVAL(outbuf,smb_err,ERRnofiles);
dptr_close(&dptr_num);
}
@@ -746,7 +746,7 @@ int reply_search(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
if(ok && expect_close && numentries == 0 && status_len == 0)
{
- CVAL(outbuf,smb_rcls) = ERRDOS;
+ SCVAL(outbuf,smb_rcls,ERRDOS);
SSVAL(outbuf,smb_err,ERRnofiles);
/* Also close the dptr - we know it's gone */
dptr_close(&dptr_num);
@@ -758,7 +758,7 @@ int reply_search(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
SSVAL(outbuf,smb_vwv0,numentries);
SSVAL(outbuf,smb_vwv1,3 + numentries * DIR_STRUCT_SIZE);
- CVAL(smb_buf(outbuf),0) = 5;
+ SCVAL(smb_buf(outbuf),0,5);
SSVAL(smb_buf(outbuf),1,numentries*DIR_STRUCT_SIZE);
if (Protocol >= PROTOCOL_NT1) {
@@ -888,11 +888,11 @@ int reply_open(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
SSVAL(outbuf,smb_vwv6,rmode);
if (oplock_request && lp_fake_oplocks(SNUM(conn))) {
- CVAL(outbuf,smb_flg) |= CORE_OPLOCK_GRANTED;
+ SCVAL(outbuf,smb_flg,CVAL(outbuf,smb_flg)|CORE_OPLOCK_GRANTED);
}
if(EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type))
- CVAL(outbuf,smb_flg) |= CORE_OPLOCK_GRANTED;
+ SCVAL(outbuf,smb_flg,CVAL(outbuf,smb_flg)|CORE_OPLOCK_GRANTED);
END_PROFILE(SMBopen);
return(outsize);
}
@@ -988,11 +988,11 @@ int reply_open_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt
*/
if (core_oplock_request && lp_fake_oplocks(SNUM(conn))) {
- CVAL(outbuf,smb_flg) |= CORE_OPLOCK_GRANTED;
+ SCVAL(outbuf,smb_flg,CVAL(outbuf,smb_flg)|CORE_OPLOCK_GRANTED);
}
if(core_oplock_request && EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type)) {
- CVAL(outbuf,smb_flg) |= CORE_OPLOCK_GRANTED;
+ SCVAL(outbuf,smb_flg,CVAL(outbuf,smb_flg)|CORE_OPLOCK_GRANTED);
}
set_message(outbuf,15,0,True);
@@ -1103,11 +1103,11 @@ int reply_mknew(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
SSVAL(outbuf,smb_vwv0,fsp->fnum);
if (oplock_request && lp_fake_oplocks(SNUM(conn))) {
- CVAL(outbuf,smb_flg) |= CORE_OPLOCK_GRANTED;
+ SCVAL(outbuf,smb_flg,CVAL(outbuf,smb_flg)|CORE_OPLOCK_GRANTED);
}
if(EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type))
- CVAL(outbuf,smb_flg) |= CORE_OPLOCK_GRANTED;
+ SCVAL(outbuf,smb_flg,CVAL(outbuf,smb_flg)|CORE_OPLOCK_GRANTED);
DEBUG( 2, ( "new file %s\n", fname ) );
DEBUG( 3, ( "mknew %s fd=%d dmode=%d umode=%o\n",
@@ -1192,11 +1192,11 @@ int reply_ctemp(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
outsize = set_message_end(outbuf, p);
if (oplock_request && lp_fake_oplocks(SNUM(conn))) {
- CVAL(outbuf,smb_flg) |= CORE_OPLOCK_GRANTED;
+ SCVAL(outbuf,smb_flg,CVAL(outbuf,smb_flg)|CORE_OPLOCK_GRANTED);
}
if (EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type))
- CVAL(outbuf,smb_flg) |= CORE_OPLOCK_GRANTED;
+ SCVAL(outbuf,smb_flg,CVAL(outbuf,smb_flg)|CORE_OPLOCK_GRANTED);
DEBUG( 2, ( "created temp file %s\n", fname ) );
DEBUG( 3, ( "ctemp %s fd=%d dmode=%d umode=%o\n",
@@ -1624,7 +1624,7 @@ int reply_read(connection_struct *conn, char *inbuf,char *outbuf, int size, int
outsize += nread;
SSVAL(outbuf,smb_vwv0,nread);
SSVAL(outbuf,smb_vwv5,nread+3);
- CVAL(smb_buf(outbuf),0) = 1;
+ SCVAL(smb_buf(outbuf),0,1);
SSVAL(smb_buf(outbuf),1,nread);
DEBUG( 3, ( "read fnum=%d num=%d nread=%d\n",
@@ -1742,8 +1742,8 @@ int reply_writebraw(connection_struct *conn, char *inbuf,char *outbuf, int size,
}
/* force the error type */
- CVAL(inbuf,smb_com) = SMBwritec;
- CVAL(outbuf,smb_com) = SMBwritec;
+ SCVAL(inbuf,smb_com,SMBwritec);
+ SCVAL(outbuf,smb_com,SMBwritec);
if (is_locked(fsp,conn,(SMB_BIG_UINT)tcount,(SMB_BIG_UINT)startpos, WRITE_LOCK,False)) {
END_PROFILE(SMBwritebraw);
@@ -1764,7 +1764,7 @@ int reply_writebraw(connection_struct *conn, char *inbuf,char *outbuf, int size,
total_written = nwritten;
/* Return a message to the redirector to tell it to send more bytes */
- CVAL(outbuf,smb_com) = SMBwritebraw;
+ SCVAL(outbuf,smb_com,SMBwritebraw);
SSVALS(outbuf,smb_vwv0,-1);
outsize = set_message(outbuf,Protocol>PROTOCOL_COREPLUS?1:0,0,True);
if (!send_smb(smbd_server_fd(),outbuf))
@@ -1780,7 +1780,7 @@ int reply_writebraw(connection_struct *conn, char *inbuf,char *outbuf, int size,
/* Set up outbuf to return the correct return */
outsize = set_message(outbuf,1,0,True);
- CVAL(outbuf,smb_com) = SMBwritec;
+ SCVAL(outbuf,smb_com,SMBwritec);
SSVAL(outbuf,smb_vwv0,total_written);
if (numtowrite != 0) {
@@ -1805,7 +1805,7 @@ int reply_writebraw(connection_struct *conn, char *inbuf,char *outbuf, int size,
nwritten = write_file(fsp,inbuf+4,startpos+nwritten,numtowrite);
if (nwritten < (ssize_t)numtowrite) {
- CVAL(outbuf,smb_rcls) = ERRHRD;
+ SCVAL(outbuf,smb_rcls,ERRHRD);
SSVAL(outbuf,smb_err,ERRdiskfull);
}
@@ -1966,7 +1966,7 @@ int reply_write(connection_struct *conn, char *inbuf,char *outbuf,int size,int d
SSVAL(outbuf,smb_vwv0,nwritten);
if (nwritten < (ssize_t)numtowrite) {
- CVAL(outbuf,smb_rcls) = ERRHRD;
+ SCVAL(outbuf,smb_rcls,ERRHRD);
SSVAL(outbuf,smb_err,ERRdiskfull);
}
@@ -2062,7 +2062,7 @@ int reply_write_and_X(connection_struct *conn, char *inbuf,char *outbuf,int leng
SSVAL(outbuf,smb_vwv4,(nwritten>>16)&1);
if (nwritten < (ssize_t)numtowrite) {
- CVAL(outbuf,smb_rcls) = ERRHRD;
+ SCVAL(outbuf,smb_rcls,ERRHRD);
SSVAL(outbuf,smb_err,ERRdiskfull);
}
@@ -2578,7 +2578,7 @@ int reply_printqueue(connection_struct *conn,
SSVAL(outbuf,smb_vwv0,0);
SSVAL(outbuf,smb_vwv1,0);
- CVAL(smb_buf(outbuf),0) = 1;
+ SCVAL(smb_buf(outbuf),0,1);
SSVAL(smb_buf(outbuf),1,0);
DEBUG(3,("printqueue start_index=%d max_count=%d\n",
@@ -2601,10 +2601,10 @@ int reply_printqueue(connection_struct *conn,
for (i=first;i<first+num_to_get;i++) {
put_dos_date2(p,0,queue[i].time);
- CVAL(p,4) = (queue[i].status==LPQ_PRINTING?2:3);
+ SCVAL(p,4,(queue[i].status==LPQ_PRINTING?2:3));
SSVAL(p,5, queue[i].job);
SIVAL(p,7,queue[i].size);
- CVAL(p,11) = 0;
+ SCVAL(p,11,0);
srvstr_push(outbuf, p+12, queue[i].user, 16, STR_ASCII);
p += 28;
}
@@ -2613,7 +2613,7 @@ int reply_printqueue(connection_struct *conn,
outsize = set_message(outbuf,2,28*count+3,False);
SSVAL(outbuf,smb_vwv0,count);
SSVAL(outbuf,smb_vwv1,(max_count>0?first+count:first-1));
- CVAL(smb_buf(outbuf),0) = 1;
+ SCVAL(smb_buf(outbuf),0,1);
SSVAL(smb_buf(outbuf),1,28*count);
}
@@ -3557,7 +3557,7 @@ int reply_setdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
}
outsize = set_message(outbuf,0,0,True);
- CVAL(outbuf,smb_reh) = CVAL(inbuf,smb_reh);
+ SCVAL(outbuf,smb_reh,CVAL(inbuf,smb_reh));
DEBUG(3,("setdir %s\n", newdir));
@@ -4044,7 +4044,7 @@ int reply_writebmpx(connection_struct *conn, char *inbuf,char *outbuf, int size,
/* If this fails we need to send an SMBwriteC response,
not an SMBwritebmpx - set this up now so we don't forget */
- CVAL(outbuf,smb_com) = SMBwritec;
+ SCVAL(outbuf,smb_com,SMBwritec);
if (is_locked(fsp,conn,(SMB_BIG_UINT)tcount,(SMB_BIG_UINT)startpos,WRITE_LOCK,False)) {
END_PROFILE(SMBwriteBmpx);
@@ -4087,7 +4087,7 @@ int reply_writebmpx(connection_struct *conn, char *inbuf,char *outbuf, int size,
/* We are returning successfully, set the message type back to
SMBwritebmpx */
- CVAL(outbuf,smb_com) = SMBwriteBmpx;
+ SCVAL(outbuf,smb_com,SMBwriteBmpx);
outsize = set_message(outbuf,1,0,True);
@@ -4104,7 +4104,7 @@ int reply_writebmpx(connection_struct *conn, char *inbuf,char *outbuf, int size,
/* Now the secondary */
outsize = set_message(outbuf,1,0,True);
- CVAL(outbuf,smb_com) = SMBwritec;
+ SCVAL(outbuf,smb_com,SMBwritec);
SSVAL(outbuf,smb_vwv0,nwritten);
}
@@ -4142,7 +4142,7 @@ int reply_writebs(connection_struct *conn, char *inbuf,char *outbuf, int dum_siz
data = smb_base(inbuf) + smb_doff;
/* We need to send an SMBwriteC response, not an SMBwritebs */
- CVAL(outbuf,smb_com) = SMBwritec;
+ SCVAL(outbuf,smb_com,SMBwritec);
/* This fd should have an auxiliary struct attached,
check that it does */
diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c
index 3addecb0b8b..60e03e002db 100644
--- a/source/smbd/trans2.c
+++ b/source/smbd/trans2.c
@@ -1614,8 +1614,8 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
SOFF_T(pdata,0,allocation_size);
SOFF_T(pdata,8,size);
SIVAL(pdata,16,sbuf.st_nlink);
- CVAL(pdata,20) = 0;
- CVAL(pdata,21) = (mode&aDIR)?1:0;
+ SCVAL(pdata,20,0);
+ SCVAL(pdata,21,(mode&aDIR)?1:0);
break;
case SMB_FILE_EA_INFORMATION:
@@ -1678,8 +1678,8 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
SOFF_T(pdata,0,allocation_size);
SOFF_T(pdata,8,size);
SIVAL(pdata,16,sbuf.st_nlink);
- CVAL(pdata,20) = delete_pending;
- CVAL(pdata,21) = (mode&aDIR)?1:0;
+ SCVAL(pdata,20,delete_pending);
+ SCVAL(pdata,21,(mode&aDIR)?1:0);
pdata += 24;
SINO_T(pdata,0,(SMB_INO_T)sbuf.st_ino);
pdata += 8; /* index number */
@@ -1728,7 +1728,7 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
case SMB_FILE_DISPOSITION_INFORMATION:
data_size = 1;
- CVAL(pdata,0) = delete_pending;
+ SCVAL(pdata,0,delete_pending);
break;
case SMB_FILE_POSITION_INFORMATION: